X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fheap.c;h=be8eeaf6e3b4dc06945d84a499e4c4f4bcc63000;hb=ea487239a8b3632d13c6e4ec92d21f0fcd460bdd;hp=4c7ffd955f21efdb5e49b4473de0d1a40eae3068;hpb=bd5e8623e509a443d7d6e1b959b79f85b0c285b7;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",