diff --git a/lladd/constants.h b/lladd/constants.h index 177953b..e7c4d9b 100644 --- a/lladd/constants.h +++ b/lladd/constants.h @@ -78,9 +78,9 @@ terms specified in this license. /*#define MAX_BUFFER_SIZE 100003 */ /*#define MAX_BUFFER_SIZE 10007*/ /*#define MAX_BUFFER_SIZE 5003*/ -/*#define MAX_BUFFER_SIZE 71 */ -#define MAX_BUFFER_SIZE 7 -#define BUFFER_ASOOCIATIVE 2 +#define MAX_BUFFER_SIZE 71 +/*#define MAX_BUFFER_SIZE 7 */ +/*#define BUFFER_ASOOCIATIVE 2 */ #define MAX_TRANSACTIONS 1000 diff --git a/src/lladd/page.c b/src/lladd/page.c index 23fe038..422501e 100644 --- a/src/lladd/page.c +++ b/src/lladd/page.c @@ -86,6 +86,9 @@ terms specified in this license. $Id$ ************************************************************************/ +/* _XOPEN_SOURCE is needed for posix_memalign */ +#define _XOPEN_SOURCE 600 +#include #include #include @@ -425,7 +428,7 @@ void pageInit() { for(int i = 0; i < MAX_BUFFER_SIZE+1; i++) { pool[i].rwlatch = initlock(); pool[i].loadlatch = initlock(); - pool[i].memAddr = malloc(PAGE_SIZE); + assert(!posix_memalign((void*)(&(pool[i].memAddr)), PAGE_SIZE, PAGE_SIZE)); } pthread_mutex_init(&lastFreepage_mutex , NULL); diff --git a/src/lladd/pageFile.c b/src/lladd/pageFile.c index 03abdd1..989b7d3 100644 --- a/src/lladd/pageFile.c +++ b/src/lladd/pageFile.c @@ -3,7 +3,6 @@ This file handles all of the file I/O for pages. */ - #include "page.h" #include @@ -103,6 +102,7 @@ void pageWrite(Page * ret) { } pthread_mutex_lock(&stable_mutex); + offset = myLseekNoLock(stable, pageoffset, SEEK_SET); assert(offset == pageoffset); assert(ret->memAddr);