]> pd.if.org Git - pdclib/blobdiff - opt/malloc-solar/free.c
Since all platforms are already configured to use dlmalloc, my old primitive placehol...
[pdclib] / opt / malloc-solar / free.c
diff --git a/opt/malloc-solar/free.c b/opt/malloc-solar/free.c
deleted file mode 100644 (file)
index 71d6b0f..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/* void free( void * )
-
-   This file is part of the Public Domain C Library (PDCLib).
-   Permission is granted to use, modify, and / or redistribute at will.
-*/
-
-#include <stdlib.h>
-
-#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. */
-
-/* structure holding first and last element of free node list */
-extern struct _PDCLIB_headnode_t _PDCLIB_memlist;
-
-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 )
-    {
-        _PDCLIB_memlist.last->next = ptr;
-    }
-    else
-    {
-        _PDCLIB_memlist.first = ptr;
-    }
-    _PDCLIB_memlist.last = ptr;
-}
-
-#endif
-
-#ifdef TEST
-#include <_PDCLIB_test.h>
-#include <stdbool.h>
-
-int main( void )
-{
-    free( NULL );
-    TESTCASE( true );
-    return TEST_RESULTS;
-}
-
-#endif