mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-27 01:59:38 -05:00
ITS#8324 additional tweaks
VirtualAlloc is only needed with WRITEMAP. Regular writes already extend the mmap implictly.
This commit is contained in:
parent
4198bbde17
commit
c4e31434c7
1 changed files with 3 additions and 2 deletions
|
|
@ -2324,7 +2324,7 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp)
|
|||
goto fail;
|
||||
}
|
||||
#ifdef _WIN32
|
||||
{
|
||||
if (env->me_flags & MDB_WRITEMAP) {
|
||||
void *p;
|
||||
p = (MDB_page *)(env->me_map + env->me_psize * pgno);
|
||||
p = VirtualAlloc(p, env->me_psize * num, MEM_COMMIT,
|
||||
|
|
@ -4260,7 +4260,8 @@ mdb_env_open2(MDB_env *env)
|
|||
/* For FIXEDMAP, make sure the file is non-empty before we attempt to map it */
|
||||
if (newenv) {
|
||||
char dummy = 0;
|
||||
rc = WriteFile(env->me_fd, &dummy, 1, NULL, NULL);
|
||||
DWORD len;
|
||||
rc = WriteFile(env->me_fd, &dummy, 1, &len, NULL);
|
||||
if (!rc) {
|
||||
rc = ErrCode();
|
||||
return rc;
|
||||
|
|
|
|||
Loading…
Reference in a new issue