Added out of memory handling to MM_Allocate
[tpg/acess2.git] / Kernel / heap.c
index e5a3723..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;
 }
 

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