marCsweep/include/gc_alloc.h
2024-09-16 17:25:07 -04:00

19 lines
346 B
C

#ifndef GC_ALLOC_H
#define GC_ALLOC_H
#include <stdio.h>
// Metadata for allocated memory
struct gc_block_header {
size_t size;
int free;
struct gc_block_header *next;
};
// Performs allocations of SIZE bytes
void *gc_malloc(size_t size);
// Frees blocks of memory allocated by 'gc_alloc'
void gc_free(void *ptr);
#endif /* GC_ALLOC_H */