Added full ANSI colour range
[tpg/acess2.git] / Kernel / heap.c
index fce510c..90b7256 100644 (file)
@@ -175,6 +175,7 @@ void *malloc(size_t Bytes)
                if(head->Size == Bytes) {
                        head->Magic = MAGIC_USED;
                        RELEASE(&giHeapSpinlock);       // Release spinlock
+                       LOG("RETURN %p", best->Data);
                        return best->Data;
                }
                
@@ -204,6 +205,7 @@ void *malloc(size_t Bytes)
                // Check size
                if(best->Size == Bytes) {
                        RELEASE(&giHeapSpinlock);       // Release spinlock
+                       LOG("RETURN %p", best->Data);
                        return best->Data;
                }
        }
@@ -222,6 +224,7 @@ void *malloc(size_t Bytes)
        best->Magic = MAGIC_USED;       // Mark block as used
        
        RELEASE(&giHeapSpinlock);       // Release spinlock
+       LOG("RETURN %p", best->Data);
        return best->Data;
 }
 
@@ -234,6 +237,9 @@ void free(void *Ptr)
        tHeapHead       *head;
        tHeapFoot       *foot;
        
+       LOG("Ptr = %p", Ptr);
+       LOG("Returns to %p", __builtin_return_address(0));
+       
        // Alignment Check
        if( (Uint)Ptr & (sizeof(Uint)-1) ) {
                Warning("free - Passed a non-aligned address (%p)\n", Ptr);

UCC git Repository :: git.ucc.asn.au