Browse Source

Free Windows thread memory with MEM_RELEASE rather than MEM_DECOMMIT

as suggested by hjmndv in #2370
tags/v0.3.8^2
Martin Kroeker GitHub 6 years ago
parent
commit
78100b8093
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      driver/others/memory.c

+ 4
- 4
driver/others/memory.c View File

@@ -822,7 +822,7 @@ static void *alloc_qalloc(void *address){

static void alloc_windows_free(struct alloc_t *alloc_info){

VirtualFree(alloc_info, allocation_block_size, MEM_DECOMMIT);
VirtualFree(alloc_info, 0, MEM_RELEASE);

}

@@ -935,7 +935,7 @@ static void alloc_hugetlb_free(struct alloc_t *alloc_info){

#ifdef OS_WINDOWS

VirtualFree(alloc_info, allocation_block_size, MEM_LARGE_PAGES | MEM_DECOMMIT);
VirtualFree(alloc_info, 0, MEM_LARGE_PAGES | MEM_RELEASE);

#endif

@@ -2310,7 +2310,7 @@ static void *alloc_qalloc(void *address){

static void alloc_windows_free(struct release_t *release){

VirtualFree(release -> address, BUFFER_SIZE, MEM_DECOMMIT);
VirtualFree(release -> address, 0, MEM_RELEASE);

}

@@ -2432,7 +2432,7 @@ static void alloc_hugetlb_free(struct release_t *release){

#ifdef OS_WINDOWS

VirtualFree(release -> address, BUFFER_SIZE, MEM_LARGE_PAGES | MEM_DECOMMIT);
VirtualFree(release -> address, 0, MEM_LARGE_PAGES | MEM_RELEASE);

#endif



Loading…
Cancel
Save