X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fheap.c;h=be8eeaf6e3b4dc06945d84a499e4c4f4bcc63000;hb=04a050f42807686dc119838c82372409246d55bb;hp=4c7ffd955f21efdb5e49b4473de0d1a40eae3068;hpb=e02f66c7125bf18f77c6c53587238cbd49da2c89;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/heap.c b/KernelLand/Kernel/heap.c index 4c7ffd95..be8eeaf6 100644 --- a/KernelLand/Kernel/heap.c +++ b/KernelLand/Kernel/heap.c @@ -153,8 +153,8 @@ void *Heap_Allocate(const char *File, int Line, size_t __Bytes) size_t Bytes; if( __Bytes == 0 ) { - //return NULL; // TODO: Return a known un-mapped range. - return INVLPTR; + return NULL; // TODO: Return a known un-mapped range. +// return INVLPTR; } // Get required size @@ -512,7 +512,12 @@ void Heap_Dump(void) { tHeapHead *head, *badHead; tHeapFoot *foot = NULL; + static int in_heap_dump; + if( in_heap_dump ) return; + + in_heap_dump = 1; + head = gHeapStart; while( (Uint)head < (Uint)gHeapEnd ) { @@ -560,12 +565,16 @@ void Heap_Dump(void) } // If the heap is valid, ok! - if( (tVAddr)head == (tVAddr)gHeapEnd ) + if( (tVAddr)head == (tVAddr)gHeapEnd ) { + in_heap_dump = 0; return ; + } // Check for a bad return - if( (tVAddr)head >= (tVAddr)gHeapEnd ) + if( (tVAddr)head >= (tVAddr)gHeapEnd ) { + in_heap_dump = 0; return ; + } #if !VERBOSE_DUMP Log_Log("Heap", "%p (%P): 0x%08lx %i %4C",