mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
Add cJSON_Allocators new style allocator struct
This commit is contained in:
8
cJSON.h
8
cJSON.h
@@ -78,6 +78,14 @@ typedef struct cJSON_Hooks
|
||||
void (*free_fn)(void *ptr);
|
||||
} cJSON_Hooks;
|
||||
|
||||
/* new style allocators with userdata (e.g. for pool allocators) */
|
||||
typedef struct cJSON_Allocators
|
||||
{
|
||||
void *(*allocate)(size_t size, void *userdata);
|
||||
void (*deallocate)(void *pointer, void *userdata);
|
||||
void *(*reallocate)(void *pointer, size_t size, void *userdata); /* optional */
|
||||
} cJSON_Allocators;
|
||||
|
||||
typedef int cJSON_bool;
|
||||
|
||||
#if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32))
|
||||
|
||||
Reference in New Issue
Block a user