From 175b7e281ebf9be5828667103afd3620bbc29ee7 Mon Sep 17 00:00:00 2001 From: Sears Russell Date: Tue, 19 Feb 2008 21:27:34 +0000 Subject: [PATCH] Zero out memory and dirty bit at initialization. --- src/stasis/bufferPool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stasis/bufferPool.c b/src/stasis/bufferPool.c index 6175fe9..bd8fc3a 100644 --- a/src/stasis/bufferPool.c +++ b/src/stasis/bufferPool.c @@ -78,7 +78,7 @@ void bufferPoolInit() { assert(!ret); addressFromMalloc = bufferSpace; #else*/ - bufferSpace = malloc(PAGE_SIZE * (MAX_BUFFER_SIZE + 2)); + bufferSpace = calloc((MAX_BUFFER_SIZE + 2), PAGE_SIZE); assert(bufferSpace); addressFromMalloc = bufferSpace; bufferSpace = (byte*)(((long)bufferSpace) + @@ -90,6 +90,7 @@ void bufferPoolInit() { pool[i].rwlatch = initlock(); pool[i].loadlatch = initlock(); pool[i].memAddr = &(bufferSpace[i*PAGE_SIZE]); + pool[i].dirty = 0; } }