summaryrefslogtreecommitdiffstats
path: root/lib/libjove/heap/heap.h
blob: 8a02655285fb850efe74b02348aedf3886a64cd9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef _LIBC_JOVE_HEAP_H
#define _LIBC_JOVE_HEAP_H 1

#include <stdint.h>
#include <stddef.h>

#define LIBC_HEAP_INIT_SIZE (0x1000)
#define LIBC_HEAP_MINALLOC (0x10)
#define LIBC_HEAP_MINSPLIT (sizeof(heap_bin_t) + sizeof(uintptr_t) + LIBC_HEAP_MINALLOC)

typedef struct heap_bin {
    struct heap_bin *next;
    size_t size_taken;
    char data[];
} heap_bin_t;

void __libjove_heap_init(uintptr_t program_end);

#endif