add SLOB allocator
This commit is contained in:
parent
efea10417c
commit
30cc709b8c
7 changed files with 389 additions and 2 deletions
15
src/sloballoc.h
Normal file
15
src/sloballoc.h
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue