| 12345678910111213141516171819202122232425262728293031 |
- #include <stdint.h>
- #include <stddef.h>
- #include <stdbool.h>
- #include "alloc.h"
- #ifdef ZV_ALLOC_USE_STDLIB
- #include <stdlib.h>
- #include <malloc.h>
- #endif
- void * zv_alloc(size_t count) {
- #ifdef ZV_ALLOC_USE_STDLIB
- return malloc(count);
- #endif
- }
- void * zv_alloc_zero(size_t count) {
- #ifdef ZV_ALLOC_USE_STDLIB
- return calloc(count, 0);
- #endif
- }
- void zv_free(void *target) {
- #ifdef ZV_ALLOC_USE_STDLIB
- free(target);
- #endif
- }
|