marCsweep/include/gc_alloc.h

20 lines
346 B
C
Raw Normal View History

#ifndef GC_ALLOC_H
#define GC_ALLOC_H
#include <stdio.h>
2024-09-16 17:25:07 -04:00
// Metadata for allocated memory
struct gc_block_header {
2024-09-06 11:05:16 -04:00
size_t size;
int free;
2024-09-16 17:25:07 -04:00
struct gc_block_header *next;
};
2024-09-16 17:25:07 -04:00
// Performs allocations of SIZE bytes
void *gc_malloc(size_t size);
2024-09-16 17:25:07 -04:00
// Frees blocks of memory allocated by 'gc_alloc'
void gc_free(void *ptr);
#endif /* GC_ALLOC_H */