14 lines
270 B
C
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;
|
|
}
|