Working on refactoring, read more

The main program segfaults, but right now I'm working on the tests, mainly.
This commit is contained in:
2022-08-29 10:21:25 +10:00
parent 4fb2dea1b4
commit 1937d727bb
18 changed files with 142 additions and 141 deletions

View File

@@ -5,12 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
static int allocatedMemoryCount = 0;
void* reallocate(void* pointer, size_t oldSize, size_t newSize) {
allocatedMemoryCount -= oldSize;
allocatedMemoryCount += newSize;
if (newSize == 0) {
free(pointer);
@@ -27,6 +22,3 @@ void* reallocate(void* pointer, size_t oldSize, size_t newSize) {
return mem;
}
int getAllocatedMemoryCount() {
return allocatedMemoryCount;
}