Skip to content

Commit 74cf359

Browse files
committed
gh-152433: Windows: fix ctypes MemoryError in UWP build
UWP does not allow allocating memory with code execution permissions.
1 parent b86a41c commit 74cf359

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/_ctypes/malloc_closure.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ static void more_core(void)
7070
#ifdef MS_WIN32
7171
item = (ITEM *)VirtualAlloc(NULL,
7272
count * sizeof(ITEM),
73-
MEM_COMMIT,
74-
PAGE_EXECUTE_READWRITE);
73+
MEM_COMMIT | MEM_RESERVE,
74+
PAGE_READWRITE);
7575
if (item == NULL)
7676
return;
7777
#else

0 commit comments

Comments
 (0)