mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 18:24:12 +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;
|
LARGE_INTEGER SectionSize;
|
||||||
int err, rc = MDBX_SUCCESS;
|
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 */
|
/* growth rw-section */
|
||||||
if (!mdbx_NtExtendSection)
|
|
||||||
return MDBX_UNABLE_EXTEND_MAPSIZE /* workaround for Wine */;
|
|
||||||
SectionSize.QuadPart = size;
|
SectionSize.QuadPart = size;
|
||||||
status = mdbx_NtExtendSection(map->section, &SectionSize);
|
status = mdbx_NtExtendSection(map->section, &SectionSize);
|
||||||
if (!NT_SUCCESS(status))
|
if (!NT_SUCCESS(status))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user