mdbx-windows: workaround for Windows10 bugs.

This resolves https://github.com/leo-yuriev/libmdbx/issues/47
This commit is contained in:
Leonid Yuriev
2018-10-20 17:17:31 +03:00
parent c2f850b566
commit 718f997502
3 changed files with 78 additions and 27 deletions

View File

@@ -1071,11 +1071,11 @@ int mdbx_mresize(int flags, mdbx_mmap_t *map, size_t size, size_t limit) {
&ReservedSize, MEM_RESERVE, PAGE_NOACCESS);
if (!NT_SUCCESS(status)) {
ReservedAddress = NULL;
if (status != /* STATUS_CONFLICTING_ADDRESSES */ 0xC0000018 ||
limit == map->length)
if (status != /* STATUS_CONFLICTING_ADDRESSES */ 0xC0000018)
goto bailout_ntstatus /* no way to recovery */;
/* assume we can change base address if mapping size changed */
/* assume we can change base address if mapping size changed or prev address
* couldn't be used */
map->address = NULL;
}
@@ -1132,8 +1132,8 @@ retry_mapview:;
if (!NT_SUCCESS(status)) {
if (status == /* STATUS_CONFLICTING_ADDRESSES */ 0xC0000018 &&
map->address && limit != map->length) {
/* try remap at another base address, but only if the limit is changing */
map->address) {
/* try remap at another base address */
map->address = NULL;
goto retry_mapview;
}