add SLOB allocator

This commit is contained in:
Sven M. Hallberg 2015-12-27 14:45:21 +01:00
parent efea10417c
commit 30cc709b8c
7 changed files with 389 additions and 2 deletions

15
src/sloballoc.h Normal file
View file

@ -0,0 +1,15 @@
#ifndef SLOBALLOC_H_SEEN
#define SLOBALLOC_H_SEEN
#include <stddef.h>
typedef struct slob SLOB;
SLOB *slobinit(void *mem, size_t size);
void *sloballoc(SLOB *slob, size_t size);
void slobfree(SLOB *slob, void *p);
// consistency check (verify internal invariants); returns 0 on success
int slobcheck(SLOB *slob);
#endif // SLOBALLOC_H_SEEN