Fix for fallback posix_memalign implementation. (Inserted missing

casts)
This commit is contained in:
Sears Russell 2006-11-08 07:22:42 +00:00
parent f458e4fcd8
commit 9294f89277

View file

@ -73,16 +73,18 @@ void bufferPoolInit() {
byte * bufferSpace ; byte * bufferSpace ;
#ifdef HAVE_POSIX_MEMALIGN /*#ifdef HAVE_POSIX_MEMALIGN
int ret = posix_memalign((void*)&bufferSpace, PAGE_SIZE, PAGE_SIZE * (MAX_BUFFER_SIZE + 1)); int ret = posix_memalign((void*)&bufferSpace, PAGE_SIZE, PAGE_SIZE * (MAX_BUFFER_SIZE + 1));
assert(!ret); assert(!ret);
addressFromMalloc = bufferSpace; addressFromMalloc = bufferSpace;
#else #else*/
bufferSpace = malloc(PAGE_SIZE * (MAX_BUFFER_SIZE + 2)); bufferSpace = malloc(PAGE_SIZE * (MAX_BUFFER_SIZE + 2));
assert(bufferSpace); assert(bufferSpace);
addressFromMalloc = bufferSpace; addressFromMalloc = bufferSpace;
bufferSpace += PAGE_SIZE - (bufferSpace % PAGE_SIZE); bufferSpace = (byte*)(((long)bufferSpace) +
#endif PAGE_SIZE -
(((long)bufferSpace) % PAGE_SIZE));
//#endif
for(int i = 0; i < MAX_BUFFER_SIZE+1; i++) { for(int i = 0; i < MAX_BUFFER_SIZE+1; i++) {
pool[i].rwlatch = initlock(); pool[i].rwlatch = initlock();