Kernel/x86 - Evil hack to do validation of virtual memory
[tpg/acess2.git] / KernelLand / Kernel / heap.c
index 6e0a4c1..396fa23 100755 (executable)
@@ -71,7 +71,7 @@ static inline tHeapFoot *Heap_PrevFoot(tHeapHead *Head) {
  */
 void *Heap_Extend(size_t Bytes)
 {
-       Debug("Heap_Extend(0x%x)", Bytes);
+       //Debug("Heap_Extend(0x%x)", Bytes);
        
        // Bounds Check
        if( gHeapEnd == (tHeapHead*)MM_KHEAP_MAX ) {
@@ -97,7 +97,7 @@ void *Heap_Extend(size_t Bytes)
        // Heap expands in pages
        for( Uint i = 0; i < pages; i ++ )
        {
-               if( !MM_Allocate( (tVAddr)gHeapEnd+(i<<12) ) )
+               if( !MM_Allocate( (tPage*)gHeapEnd + i ) )
                {
                        Warning("OOM - Heap_Extend (%i bytes)");
                        Heap_Dump();

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