diff options
| author | Karsten Schmidt <k@postspectacular.com> | 2017-07-14 14:39:23 +0100 |
|---|---|---|
| committer | Karsten Schmidt <k@postspectacular.com> | 2017-07-14 14:39:23 +0100 |
| commit | ad15f9bba1efece0c8954484900e9e2c5338f711 (patch) | |
| tree | 9f51be310605700dd18d6fbf22f09d9cea8907f9 /talloc.h | |
| parent | 3184e82a0d8af3de2d97a01e8fe3f6f9796da275 (diff) | |
| download | tinyalloc-ad15f9bba1efece0c8954484900e9e2c5338f711.tar.gz | |
add talloc.h, rename types & functions
Diffstat (limited to 'talloc.h')
| -rw-r--r-- | talloc.h | 31 |
1 files changed, 31 insertions, 0 deletions
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 <stdbool.h> +#include <stddef.h> + +#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(); |
