1
0
forked from GitHub/gf-core

hopefully last attempt

This commit is contained in:
Krasimir Angelov
2022-05-20 16:15:45 +02:00
parent 607b8d6d23
commit 37e1707f18

View File

@@ -260,7 +260,7 @@ PgfDB::PgfDB(const char* filepath, int flags, int mode) {
base = ((unsigned char *) ms) + page_size; base = ((unsigned char *) ms) + page_size;
} }
hМutex = CreateMutex(NULL, FALSE, mutex_name); hMutex = CreateMutex(NULL, FALSE, mutex_name);
if (hМutex == NULL) { if (hМutex == NULL) {
if (fd < 0) { if (fd < 0) {
::free(ms); ::free(ms);
@@ -1416,9 +1416,10 @@ void PgfDB::resize_map(size_t new_size)
if (ms == NULL) if (ms == NULL)
throw pgf_systemerror(last_error_to_errno()); throw pgf_systemerror(last_error_to_errno());
} else { } else {
new_ms = (malloc_state*) ::realloc(ms, new_size); malloc_state *new_ms = (malloc_state*) ::realloc(ms, new_size);
if (new_ms == NULL) if (new_ms == NULL)
throw pgf_systemerror(ENOMEM); throw pgf_systemerror(ENOMEM);
ms = new_ms;
} }
new_size -= page_size; new_size -= page_size;