clox/src/memory.c

14 lines
270 B
C
Raw Normal View History

2024-08-31 17:41:43 +00:00
#include <stdlib.h>
#include "../include/memory.h"
void *reallocate(void *pointer, size_t oldCap, size_t newCap){
if(newCap == 0){
free(pointer);
return NULL;
}
(void)oldCap;
void *result = realloc(pointer,newCap);
return result;
}