mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:54:14 +08:00
mdbx-windows: remap whole section for mmap-resize if NtExtendSection()
not available (Wine).
Some workaround for https://github.com/miranda-ng/miranda-ng/issues/1209 Change-Id: I8ce3cb0fb8bdc9bd36a05ab53343efbe4080d1f3
This commit is contained in:
parent
ddee04d991
commit
23fd4444b5
@ -1451,10 +1451,9 @@ MDBX_INTERNAL_FUNC int mdbx_mresize(int flags, mdbx_mmap_t *map, size_t size,
|
||||
LARGE_INTEGER SectionSize;
|
||||
int err, rc = MDBX_SUCCESS;
|
||||
|
||||
if (!(flags & MDBX_RDONLY) && limit == map->limit && size > map->current) {
|
||||
if (!(flags & MDBX_RDONLY) && limit == map->limit && size > map->current &&
|
||||
/* workaround for Wine */ mdbx_NtExtendSection) {
|
||||
/* growth rw-section */
|
||||
if (!mdbx_NtExtendSection)
|
||||
return MDBX_UNABLE_EXTEND_MAPSIZE /* workaround for Wine */;
|
||||
SectionSize.QuadPart = size;
|
||||
status = mdbx_NtExtendSection(map->section, &SectionSize);
|
||||
if (!NT_SUCCESS(status))
|
||||
|
Loading…
x
Reference in New Issue
Block a user