summaryrefslogtreecommitdiff
path: root/source/kit/allocator.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/kit/allocator.h')
-rw-r--r--source/kit/allocator.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/kit/allocator.h b/source/kit/allocator.h
index f6dc62d..f0f5c8d 100644
--- a/source/kit/allocator.h
+++ b/source/kit/allocator.h
@@ -11,7 +11,14 @@
extern "C" {
#endif
-enum { KIT_ALLOCATE, KIT_DEALLOCATE, KIT_REALLOCATE };
+enum {
+ KIT_ALLOCATE,
+ KIT_ALLOCATE_ZERO,
+ KIT_DEALLOCATE,
+ KIT_REALLOCATE,
+ KIT_REALLOCATE_ZERO,
+ KIT_DEALLOCATE_ALL
+};
typedef void *(*kit_allocate_fn)(int request, void *state,
ptrdiff_t size,
@@ -19,6 +26,7 @@ typedef void *(*kit_allocate_fn)(int request, void *state,
void *pointer);
typedef struct {
+ int type;
void *state;
kit_allocate_fn allocate;
} kit_allocator_t;
@@ -34,6 +42,9 @@ void *kit_alloc_dispatch(kit_allocator_t alloc, int request,
kit_allocator_t kit_alloc_default(void);
+kit_allocator_t kit_alloc_bump(ptrdiff_t size, void *buffer,
+ kit_allocator_t upstream);
+
#ifdef __cplusplus
}
#endif