clox/src/memory.c
2024-08-31 12:41:43 -05:00

14 lines
270 B
C

#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;
}