Use NUM_METAS instead of bare constant

vl32b
Howard Chu 9 years ago
parent 4ab86e3b39
commit 3a48620f37
  1. 4
      libraries/liblmdb/mdb.c

@ -4162,7 +4162,7 @@ mdb_env_map(MDB_env *env, void *addr)
return rc; return rc;
map = addr; map = addr;
#ifdef MDB_VL32 #ifdef MDB_VL32
msize = 2 * env->me_psize; msize = NUM_METAS * env->me_psize;
#endif #endif
rc = NtMapViewOfSection(mh, GetCurrentProcess(), &map, 0, 0, NULL, &msize, ViewUnmap, alloctype, pageprot); rc = NtMapViewOfSection(mh, GetCurrentProcess(), &map, 0, 0, NULL, &msize, ViewUnmap, alloctype, pageprot);
#ifdef MDB_VL32 #ifdef MDB_VL32
@ -5239,7 +5239,7 @@ mdb_env_close0(MDB_env *env, int excl)
if (env->me_map) { if (env->me_map) {
#ifdef MDB_VL32 #ifdef MDB_VL32
munmap(env->me_map, 2*env->me_psize); munmap(env->me_map, NUM_METAS*env->me_psize);
#else #else
munmap(env->me_map, env->me_mapsize); munmap(env->me_map, env->me_mapsize);
#endif #endif

Loading…
Cancel
Save