Kernel/PCI - Updated PCI API to take the protocol field into account
[tpg/acess2.git] / Kernel / heap.c
index 6d099b3..5593c68 100644 (file)
@@ -684,7 +684,10 @@ void Heap_Stats(void)
        else
                frag = 0;
        Log_Log("Heap", "%i.%02i%% Heap Fragmentation", frag/100, frag%100);
-       avgAlloc = (totalBytes-freeBytes)/(nBlocks-nFree);
+       if(nBlocks <= nFree)
+               avgAlloc = 0;
+       else
+               avgAlloc = (totalBytes-freeBytes)/(nBlocks-nFree);
        if(avgAlloc != 0)
                overhead = (sizeof(tHeapFoot)+sizeof(tHeapHead))*10000/avgAlloc;
        else

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