aboutsummaryrefslogtreecommitdiffstats
path: root/clox/src/memory.h
diff options
context:
space:
mode:
Diffstat (limited to 'clox/src/memory.h')
-rw-r--r--clox/src/memory.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/clox/src/memory.h b/clox/src/memory.h
index a810bd7..f7946f6 100644
--- a/clox/src/memory.h
+++ b/clox/src/memory.h
@@ -2,10 +2,13 @@
#define clox_memory_h
#include "common.h"
+#include "object.h"
#define ALLOCATE(type, count) \
(type *)reallocate(NULL, 0, sizeof(type) * (count))
+#define FREE(type, pointer) reallocate(pointer, sizeof(type), 0)
+
#define GROW_CAPACITY(capacity) ((capacity) < 8 ? 8 : (capacity)*2)
#define GROW_ARRAY(type, pointer, oldCount, newCount) \
@@ -16,5 +19,6 @@
reallocate(pointer, sizeof(type) * (oldCount), 0)
void *reallocate(void *pointer, size_t oldSize, size_t newSize);
+void freeObjects();
#endif