| 144 */ |
144 */ |
| 145 typedef void*(cx_clone_func)(void *target, const void *source, |
145 typedef void*(cx_clone_func)(void *target, const void *source, |
| 146 const CxAllocator *allocator, void *data); |
146 const CxAllocator *allocator, void *data); |
| 147 |
147 |
| 148 /** |
148 /** |
| |
149 * Returns the system's memory page size. |
| |
150 * |
| |
151 * If the page size cannot be retrieved from the system, |
| |
152 * a default of 4096 bytes is assumed. |
| |
153 * |
| |
154 * @return the system's memory page size in bytes |
| |
155 */ |
| |
156 cx_attr_nodiscard |
| |
157 CX_EXPORT unsigned long cx_system_page_size(void); |
| |
158 |
| |
159 /** |
| 149 * Reallocate a previously allocated block and changes the pointer in-place, |
160 * Reallocate a previously allocated block and changes the pointer in-place, |
| 150 * if necessary. |
161 * if necessary. |
| 151 * |
162 * |
| 152 * @note This will use stdlib reallocate and @em not the cxDefaultAllocator. |
163 * @note This will use stdlib reallocate and @em not the cxDefaultAllocator. |
| 153 * |
164 * |
| 426 /** |
437 /** |
| 427 * Convenience macro that invokes cxReallocArray() with the cxDefaultAllocator. |
438 * Convenience macro that invokes cxReallocArray() with the cxDefaultAllocator. |
| 428 */ |
439 */ |
| 429 #define cxReallocArrayDefault(...) cxReallocArray(cxDefaultAllocator, __VA_ARGS__) |
440 #define cxReallocArrayDefault(...) cxReallocArray(cxDefaultAllocator, __VA_ARGS__) |
| 430 /** |
441 /** |
| 431 * Convenience macro that invokes cxFree() with the cxDefaultAllocator. |
442 * Convenience function that invokes cxFree() with the cxDefaultAllocator. |
| 432 */ |
443 */ |
| 433 #define cxFreeDefault(...) cxFree(cxDefaultAllocator, __VA_ARGS__) |
444 CX_EXPORT void cxFreeDefault(void *mem); |
| 434 |
445 |
| 435 #ifdef __cplusplus |
446 #ifdef __cplusplus |
| 436 } // extern "C" |
447 } // extern "C" |
| 437 #endif |
448 #endif |
| 438 |
449 |