Fixed runtime errors.

This commit is contained in:
2024-03-02 12:55:54 -08:00
parent 7464c85692
commit 6e9c27b71e
3 changed files with 128 additions and 90 deletions

View File

@@ -6,12 +6,6 @@
#include <stdlib.h>
#include <sys/syscall.h>
#define ALIGN4(s) (((((s)-1)>>2)<<2)+4)
#define ALIGN16(s) (((s) + 15) & ~0x0F)
#define ALIGNMENT 4
#define BLOCK_SIZE sizeof(struct Block)
#define MINIMUM_BLOCK_SIZE (sizeof(struct Block) + 16)
enum MemMode : unsigned char
{
MEM_MODE_SPEED, // Memory will be allocated more quickly but loses memory efficiency.
@@ -34,9 +28,10 @@ void *realloc(void *ptr, size_t newSize);
/// @param [in] ptr The memory to flag as free.
void free(void *ptr);
size_t get_header_size();
/// Will retrieve the current real byte size of the heap.
/// @returns The size in bytes.
size_t get_heap_size();
/// Will check memory blocks on program exit if there's dangling memory.
void check_memory();
void cleanup_memory();