diff src/os/heap.c @ 150:e72f984619c7

Consolidated a lot of the defines which relate to the memory layout There is a new file (include/os/memLayout.h) which now includes just about all the #defines
author Jonathan Pevarnek <pevarnj@gmail.com>
date Wed, 02 Nov 2011 09:55:09 -0400
parents eb69d1caa83b
children 54ccc4f06e6b
line wrap: on
line diff
--- a/src/os/heap.c	Sun Oct 30 00:24:35 2011 -0400
+++ b/src/os/heap.c	Wed Nov 02 09:55:09 2011 -0400
@@ -1,6 +1,7 @@
 #include <os/heap.h>
 #include <memHead.h>
 #include <os/storageKeys.h>
+#include <os/memLayout.h>
 
 static Header base;
 static Header *allocp = NULL;
@@ -34,8 +35,8 @@
 			}
 			allocp = prev;
 			intptr_t ptr;
-			for(ptr = (intptr_t)cur; (ptr - (intptr_t)cur)/PageSize < nUnits; ptr += PageSize) {
-				setStorageKey(ptr, PROGSK, 1);
+			for(ptr = (intptr_t)cur; (ptr - (intptr_t)cur)/BLOCKSIZE < nUnits; ptr += PageSize) {
+				setStorageKey(ptr, PROGSK, 1); //TODO only do this if being called by the program (how?)
 			}
 			return (void*)(cur + 1);
 		} else if(cur == allocp) { //We went back to the start...