From ad15f9bba1efece0c8954484900e9e2c5338f711 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Fri, 14 Jul 2017 14:39:23 +0100 Subject: add talloc.h, rename types & functions --- talloc.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 talloc.h (limited to 'talloc.h') diff --git a/talloc.h b/talloc.h new file mode 100644 index 0000000..f96cc43 --- /dev/null +++ b/talloc.h @@ -0,0 +1,31 @@ +#include +#include + +#ifndef TA_ALIGN +#define TA_ALIGN 8 +#endif + +#ifndef TA_BASE +#define TA_BASE 0x400 +#endif + +#ifndef TA_HEAP_START +#define TA_HEAP_START 0x444 +#endif + +#ifndef TA_HEAP_LIMIT +#define TA_HEAP_LIMIT (1 << 24) +#endif + +#ifndef TA_HEAP_BLOCKS +#define TA_HEAP_BLOCKS 0x4 +#endif + +bool talloc_init(); +void *talloc(size_t num); +bool talloc_free(void *ptr); + +size_t talloc_num_free(); +size_t talloc_num_used(); +size_t talloc_num_avail(); +bool talloc_check(); -- cgit v1.2.3