3 /* void * realloc( void *, size_t )
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
15 /* TODO: Primitive placeholder. Improve. */
17 void * realloc( void * ptr, size_t size )
21 return malloc( size );
24 struct _PDCLIB_memnode_t * baseptr = (struct _PDCLIB_memnode_t *)( (char *)ptr - sizeof( struct _PDCLIB_memnode_t ) );
25 if ( baseptr->size >= size )
31 void * newptr = malloc( size );
32 memcpy( newptr, ptr, baseptr->size );
43 #include <_PDCLIB_test.h>
47 /* tests covered in malloc test driver */