X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fheap.c;h=90b7256ef4d411e7b50fbb9a3e15200b0b2f7ae0;hb=73cd7e192fd21be9366b7368126dec86a6026800;hp=fce510cdf9b97dd961a5430a92ef8eed7c865542;hpb=8bc40333b1401d7616b225945fee53d972c2f418;p=tpg%2Facess2.git diff --git a/Kernel/heap.c b/Kernel/heap.c index fce510cd..90b7256e 100644 --- a/Kernel/heap.c +++ b/Kernel/heap.c @@ -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);