Skip to content

Commit 78100b8

Browse files
authored
Free Windows thread memory with MEM_RELEASE rather than MEM_DECOMMIT
as suggested by hjmndv in #2370
1 parent b8f3605 commit 78100b8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

driver/others/memory.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ static void *alloc_qalloc(void *address){
822822

823823
static void alloc_windows_free(struct alloc_t *alloc_info){
824824

825-
VirtualFree(alloc_info, allocation_block_size, MEM_DECOMMIT);
825+
VirtualFree(alloc_info, 0, MEM_RELEASE);
826826

827827
}
828828

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

936936
#ifdef OS_WINDOWS
937937

938-
VirtualFree(alloc_info, allocation_block_size, MEM_LARGE_PAGES | MEM_DECOMMIT);
938+
VirtualFree(alloc_info, 0, MEM_LARGE_PAGES | MEM_RELEASE);
939939

940940
#endif
941941

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

23112311
static void alloc_windows_free(struct release_t *release){
23122312

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

23152315
}
23162316

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

24332433
#ifdef OS_WINDOWS
24342434

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

24372437
#endif
24382438

0 commit comments

Comments
 (0)