Skip to content

Commit

Permalink
Improve ident of code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Base committed May 24, 2021
1 parent 85de90e commit 233fc38
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions README.md
Expand Up @@ -203,25 +203,26 @@ program using Onion and Boehm's GC should first define a memory
failure routine which should never return:

```C
/* the memory failure routine should never return! */
static void memory_failure(const char*msg) {
perror(msg);
exit(EXIT_FAILURE);
};
/* the memory failure routine should never return! */
static void memory_failure(const char*msg) {
perror(msg);
exit(EXIT_FAILURE);
};
```
Then, your program (using both onion and Boehm's GC) should initialize
both memory routines and threads, like:
```C
onion_low_initialize_memory_allocation
(GC_malloc, GC_malloc_atomic, GC_calloc,
GC_realloc, GC_strdup, GC_free,
memory_failure);
onion_low_initialize_threads
(GC_pthread_create, GC_pthread_join,
GC_pthread_cancel, GC_pthread_detach,
GC_pthread_exit, GC_pthread_sigmask);
onion_low_initialize_memory_allocation
(GC_malloc, GC_malloc_atomic, GC_calloc,
GC_realloc, GC_strdup, GC_free,
memory_failure);
onion_low_initialize_threads
(GC_pthread_create, GC_pthread_join,
GC_pthread_cancel, GC_pthread_detach,
GC_pthread_exit, GC_pthread_sigmask);
```

You might need to define your `GC_calloc` using `GC_malloc` and
Expand All @@ -239,10 +240,10 @@ wanted to name threads created by the onion library (using
It can be cross compiled for ARM directly from cmake. Just do:

```bash
$ mkdir arm
$ cd arm
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../toolchain/arm.txt
$ make
$ mkdir arm
$ cd arm
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../toolchain/arm.txt
$ make
```

It needs the current system opack and otemplate to compile some examples, so if you want to use
Expand Down

0 comments on commit 233fc38

Please sign in to comment.