aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/shed/memory.h
blob: 3c057149610bb633f28c4615e584cbec23c8d5fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <stdint.h>

#ifndef SHED_MEMORY_H
#define SHED_MEMORY_H

/**
 * Initialise the heap and return a pointer to the current end of the heap,
 * aligned to the given alignment.
 *
 * Returns -1 on failure.
 */
void* shed__runtime__memory_init(intptr_t alignment);

/**
 * Grow the heap by at least the given increment, and return a pointer to the
 * allocated region.
 *
 * The caller is responsible for ensuring that the increment is a multiple of
 * the alignment passed to shed__runtime__memory_init.
 *
 * Returns -1 on failure.
 */
void* shed__runtime__memory_grow(intptr_t increment);

#endif