changeset 153:b523bc9c9a74

Fixed a bug in allocheap When a block was found with the exact number of pages free as were requested, the wrong value was returned for the size of that block. This fixes that.
author Jonathan Pevarnek <pevarnj@gmail.com>
date Wed, 02 Nov 2011 21:42:28 -0400
parents 54ccc4f06e6b
children 0d0ce48aa55d
files src/os/heap.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/heap.c	Wed Nov 02 21:34:56 2011 -0400
+++ b/src/os/heap.c	Wed Nov 02 21:42:28 2011 -0400
@@ -31,8 +31,8 @@
 				temp->next = cur->next;
 				prev->next = temp;
 				cur->size = nUnits;
-				*ammt = cur->size*PageSize - sizeof(Header);
 			}
+			*ammt = cur->size*PageSize - sizeof(Header);
 			allocp = prev;
 			intptr_t ptr;
 			for(ptr = (intptr_t)cur; (ptr - (intptr_t)cur)/BLOCKSIZE < nUnits; ptr += PageSize) {