Fix for fallback posix_memalign implementation. (Inserted missing
casts)
This commit is contained in:
parent
f458e4fcd8
commit
9294f89277
1 changed files with 6 additions and 4 deletions
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue