25 lines
489 B
C
25 lines
489 B
C
#ifndef C09_SMALLOC_H
|
|
#define C09_SMALLOC_H
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
enum {
|
|
C09_SMALLOC_ALIGNMENT = 16,
|
|
C09_SMALLOC_HEADER_BYTES = 16,
|
|
C09_SMALLOC_MAGIC = 0x534D414CU
|
|
};
|
|
|
|
typedef struct {
|
|
uint32_t magic;
|
|
uint32_t requested_bytes;
|
|
uint32_t reserved_bytes;
|
|
uint32_t sequence;
|
|
} C09SmallocInfo;
|
|
|
|
void c09_smalloc_reset(void);
|
|
void *c09_smalloc(size_t requested_bytes);
|
|
int c09_smalloc_inspect(const void *payload, C09SmallocInfo *result);
|
|
|
|
#endif
|