allocator.h

#ifdef GDSTK_CUSTOM_ALLOCATOR

void* allocate(uint64_t size);

void* reallocate(void* ptr, uint64_t size);

void* allocate_clear(uint64_t size);

void free_allocation(void* ptr);

#else  // GDSTK_CUSTOM_ALLOCATOR

inline void* allocate(uint64_t size) { return malloc(size); };

inline void* reallocate(void* ptr, uint64_t size) { return realloc(ptr, size); };

inline void* allocate_clear(uint64_t size) { return calloc(1, size); };

inline void free_allocation(void* ptr) { free(ptr); };

#endif  // GDSTK_CUSTOM_ALLOCATOR