X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdlib%2Fmalloc.c;h=ab0920b8bb7f959336f8f63aa6eb56ec3806d554;hb=5bf06fe94c113d389ff58afbc7e94d836e18db08;hp=2286d0d3c00273c7717faddf802c1652cf60094c;hpb=8130f23f1b48ba7fc0d22365bb38dcd396144911;p=pdclib diff --git a/functions/stdlib/malloc.c b/functions/stdlib/malloc.c index 2286d0d..ab0920b 100644 --- a/functions/stdlib/malloc.c +++ b/functions/stdlib/malloc.c @@ -121,12 +121,12 @@ void * malloc( size_t size ) if ( _PDCLIB_memlist.last == NULL ) { _PDCLIB_memlist.first = splitnode; - splitnode->next = NULL; } else { _PDCLIB_memlist.last->next = splitnode; } + splitnode->next = NULL; /* TODO: This is bug #7, uncovered by testdriver yet. */ _PDCLIB_memlist.last = splitnode; } return (char *)newnode + sizeof( struct _PDCLIB_memnode_t ); @@ -165,8 +165,6 @@ void * sbrk( intptr_t ); int main( void ) { #ifndef REGTEST - printf( "Start of malloc() testing...\n" ); - { void * ptr1, * ptr2, * ptr3, * ptr4, * ptr5, * ptr6, * ptr7, * ptr8, * ptr9; char * pages_start = _PDCLIB_allocpages( 0 ); /* allocating 10 byte; expected: 1 page allocation, node split */ @@ -239,10 +237,8 @@ int main( void ) TESTCASE( memset( ptr9, 0, 4072 ) == ptr9 ); TESTCASE( PAGETEST( 9 ) ); NODETRACE( 17 ); - printf( "End of malloc() testing.\n" ); - } #else - puts( "No testing of malloc() - test driver does not know internals of system function." ); + puts( " NOTEST malloc() test driver is PDCLib-specific." ); #endif return TEST_RESULTS; }