blob: 45e62a73c6c9edbf92285c962edf321420a85c63 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#pragma once
#include <stdint.h>
#include <stddef.h>
#define MAGIC_COOKIE_BYTES 32
#define ADDRESS_BITS (8 * sizeof(void*))
void init_buddy(uint8_t *base, size_t size,
uint8_t magic[MAGIC_COOKIE_BYTES]);
void *allocate(size_t size);
void liberate(void *base, size_t size);
void debug_buddy(void);
// "advanced features"
void *reallocate(void *old, size_t old_size, size_t new_size);
void preallocate(void *start, size_t size);
|