mdbx: roundup buffer size inside env_copy2fd().

Change-Id: Iaa9d1adb934d36a28be3804683ffbaf43552d54b
This commit is contained in:
Leonid Yuriev 2019-10-11 13:21:38 +03:00
parent 4d692821cb
commit 8861f1377c

View File

@ -13087,8 +13087,9 @@ int __cold mdbx_env_copy2fd(MDBX_env *env, mdbx_filehandle_t fd,
}
const size_t buffer_size =
pgno2bytes(env, NUM_METAS) +
((flags & MDBX_CP_COMPACT) ? MDBX_WBUF * 2 : MDBX_WBUF);
mdbx_roundup2(pgno2bytes(env, NUM_METAS) +
((flags & MDBX_CP_COMPACT) ? MDBX_WBUF * 2 : MDBX_WBUF),
env->me_os_psize);
uint8_t *buffer = NULL;
int rc = mdbx_memalign_alloc(env->me_os_psize, buffer_size, (void **)&buffer);