-/* $Id$ */
-
/* void free( void * )
This file is part of the Public Domain C Library (PDCLib).
#ifndef REGTEST
-#ifndef _PDCLIB_INT_H
-#define _PDCLIB_INT_H _PDCLIB_INT_H
#include <_PDCLIB_int.h>
-#endif
/* TODO: Primitive placeholder. Much room for improvement. */
void free( void * ptr )
{
+ if ( ptr == NULL )
+ {
+ return;
+ }
ptr = (void *)( (char *)ptr - sizeof( struct _PDCLIB_memnode_t ) );
( (struct _PDCLIB_memnode_t *)ptr )->next = NULL;
if ( _PDCLIB_memlist.last != NULL )
#ifdef TEST
#include <_PDCLIB_test.h>
+#include <stdbool.h>
int main( void )
{
- /* tests covered in malloc test driver */
+ free( NULL );
+ TESTCASE( true );
return TEST_RESULTS;
}