Added allocator and first cut at makefile
This commit is contained in:
parent
2e3aa10af0
commit
5ee7865458
5 changed files with 95 additions and 0 deletions
12
lib/allocator.h
Normal file
12
lib/allocator.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#ifndef LIB_ALLOCATOR__H__
|
||||
#define LIB_ALLOCATOR__H__
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef struct arena* arena_t; // hidden implementation
|
||||
|
||||
arena_t new_arena(size_t block_size); // pass 0 for default...
|
||||
void* arena_malloc(arena_t arena, size_t count); // TODO: needs the malloc attribute
|
||||
void delete_arena(arena_t arena);
|
||||
|
||||
|
||||
#endif // #ifndef LIB_ALLOCATOR__H__
|
||||
Loading…
Add table
Add a link
Reference in a new issue