Just use memalign, not posix_memalign

Everything has it. Solaris doesn't have posix_memalign.
vl32
Howard Chu 10 years ago
parent 899b23f89d
commit ada2630699
  1. 7
      libraries/liblmdb/mdb.c

@ -85,6 +85,7 @@ extern int cacheflush(char *addr, int nbytes, int cache);
#include <inttypes.h> #include <inttypes.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <malloc.h>
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
@ -8469,9 +8470,9 @@ mdb_env_copyfd1(MDB_env *env, HANDLE fd)
#else #else
pthread_mutex_init(&my.mc_mutex, NULL); pthread_mutex_init(&my.mc_mutex, NULL);
pthread_cond_init(&my.mc_cond, NULL); pthread_cond_init(&my.mc_cond, NULL);
rc = posix_memalign((void **)&my.mc_wbuf[0], env->me_os_psize, MDB_WBUF*2); my.mc_wbuf[0] = memalign(env->me_os_psize, MDB_WBUF*2);
if (rc) if (my.mc_wbuf[0] == NULL)
return rc; return errno;
#endif #endif
memset(my.mc_wbuf[0], 0, MDB_WBUF*2); memset(my.mc_wbuf[0], 0, MDB_WBUF*2);
my.mc_wbuf[1] = my.mc_wbuf[0] + MDB_WBUF; my.mc_wbuf[1] = my.mc_wbuf[0] + MDB_WBUF;

Loading…
Cancel
Save