m1n1/src/heapblock.h
Hector Martin 986c6730e9 Add heapblock and dlmalloc for managing memory
heapblock is a simple `sbrk` style implementation, also useful as an
"endless" decompression buffer. dlmalloc is used on top as a malloc
implementation.

This also changes how the Python side manages its heap. We still use a
python-side malloc implementation (since this is faster), and we put the
Python heap at the m1n1 heap + 128MB, without allocating it.
Hopefully this should never step on anything m1n1 neads, and avoids
having to manage freeing across Python script calls.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-29 16:25:15 +09:00

13 lines
227 B
C

/* SPDX-License-Identifier: MIT */
#ifndef HEAPBLOCK_H
#define HEAPBLOCK_H
#include "types.h"
void heapblock_init(void);
void *heapblock_alloc(size_t size);
void *heapblock_alloc_aligned(size_t size, size_t align);
#endif