Skip to content

Commit 2fcfa47

Browse files
authored
Update memory.h
1 parent 900d73d commit 2fcfa47

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

memory.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#include <stddef.h>
55

6+
void* reallocate(void* pointer, size_t oldSize, size_t newSize);
7+
68
#define GROW_CAPACITY(capacity) \
79
((capacity) < 8 ? 8 : (capacity) * 2)
810

@@ -16,6 +18,7 @@
1618
#define ALLOCATE(type, count) \
1719
(type*)reallocate(NULL, 0, sizeof(type) * (count))
1820

19-
#define FREE(type, pointer) reallocate(pointer, sizeof(type), 0)
21+
#define FREE(type, pointer) \
22+
reallocate(pointer, sizeof(type), 0)
2023

2124
#endif

0 commit comments

Comments
 (0)