|
126 | 126 | #endif |
127 | 127 |
|
128 | 128 | /** |
129 | | - * If you build prism with a custom allocator, configure it with "-D PRISM_XALLOCATOR" |
130 | | - * to use your own allocator that defines xmalloc, xrealloc, xcalloc, and xfree. |
131 | | - * For example, your `custom_allocator.h` file could look like this: |
| 129 | + * If you build prism with a custom allocator, configure it with |
| 130 | + * "-D PRISM_XALLOCATOR" to use your own allocator that defines xmalloc, |
| 131 | + * xrealloc, xcalloc, and xfree. |
| 132 | + * |
| 133 | + * For example, your `prism_xallocator.h` file could look like this: |
| 134 | + * |
132 | 135 | * ``` |
133 | 136 | * #ifndef PRISM_XALLOCATOR_H |
134 | 137 | * #define PRISM_XALLOCATOR_H |
|
140 | 143 | * ``` |
141 | 144 | */ |
142 | 145 | #ifdef PRISM_XALLOCATOR |
143 | | -# include "prism_xallocator.h" |
| 146 | + #include "prism_xallocator.h" |
144 | 147 | #else |
145 | | -# define xmalloc malloc |
146 | | -# define xrealloc realloc |
147 | | -# define xcalloc calloc |
148 | | -# define xfree free |
| 148 | + /** |
| 149 | + * The malloc function that should be used. This can be overriden with the |
| 150 | + * PRISM_XALLOCATOR define. |
| 151 | + */ |
| 152 | + #define xmalloc malloc |
| 153 | + |
| 154 | + /** |
| 155 | + * The realloc function that should be used. This can be overriden with the |
| 156 | + * PRISM_XALLOCATOR define. |
| 157 | + */ |
| 158 | + #define xrealloc realloc |
| 159 | + |
| 160 | + /** |
| 161 | + * The calloc function that should be used. This can be overriden with the |
| 162 | + * PRISM_XALLOCATOR define. |
| 163 | + */ |
| 164 | + #define xcalloc calloc |
| 165 | + |
| 166 | + /** |
| 167 | + * The free function that should be used. This can be overriden with the |
| 168 | + * PRISM_XALLOCATOR define. |
| 169 | + */ |
| 170 | + #define xfree free |
149 | 171 | #endif |
150 | 172 |
|
151 | 173 | #endif |
0 commit comments