Skip to content

Free Windows thread memory with MEM_RELEASE rather than MEM_DECOMMIT #2371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions driver/others/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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);

}

Expand Down Expand Up @@ -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

Expand Down