2012-04-23 19:39:44 +01:00
|
|
|
#ifndef HAMMER_ALLOCATOR__H__
|
|
|
|
|
#define HAMMER_ALLOCATOR__H__
|
2012-04-23 00:35:58 +01:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
|
|
typedef struct arena* arena_t; // hidden implementation
|
|
|
|
|
|
|
|
|
|
arena_t new_arena(size_t block_size); // pass 0 for default...
|
2012-04-29 01:45:52 +01:00
|
|
|
void* arena_malloc(arena_t arena, size_t count) __attribute__(( malloc, alloc_size(2) ));
|
2012-04-23 00:35:58 +01:00
|
|
|
void delete_arena(arena_t arena);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // #ifndef LIB_ALLOCATOR__H__
|