File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ What's New in Python 3.4.0 Alpha 1?
1010Core and Builtins
1111-----------------
1212
13+ - Issue #13483: Use VirtualAlloc in obmalloc on Windows.
14+
1315- Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise
1416 OverflowError when an argument of %c format is out of range.
1517
Original file line number Diff line number Diff line change 99 #endif
1010#endif
1111
12+ #ifdef MS_WINDOWS
13+ #include <windows.h>
14+ #endif
15+
1216#ifdef WITH_VALGRIND
1317#include <valgrind/valgrind.h>
1418
@@ -598,7 +602,11 @@ new_arena(void)
598602 arenaobj = unused_arena_objects ;
599603 unused_arena_objects = arenaobj -> nextarena ;
600604 assert (arenaobj -> address == 0 );
601- #ifdef ARENAS_USE_MMAP
605+ #ifdef MS_WINDOWS
606+ address = (void * )VirtualAlloc (NULL , ARENA_SIZE ,
607+ MEM_COMMIT | MEM_RESERVE , PAGE_READWRITE );
608+ err = (address == NULL );
609+ #elif defined(ARENAS_USE_MMAP )
602610 address = mmap (NULL , ARENA_SIZE , PROT_READ |PROT_WRITE ,
603611 MAP_PRIVATE |MAP_ANONYMOUS , -1 , 0 );
604612 err = (address == MAP_FAILED );
@@ -1093,7 +1101,9 @@ PyObject_Free(void *p)
10931101 unused_arena_objects = ao ;
10941102
10951103 /* Free the entire arena. */
1096- #ifdef ARENAS_USE_MMAP
1104+ #ifdef MS_WINDOWS
1105+ VirtualFree ((void * )ao -> address , 0 , MEM_RELEASE );
1106+ #elif defined(ARENAS_USE_MMAP )
10971107 munmap ((void * )ao -> address , ARENA_SIZE );
10981108#else
10991109 free ((void * )ao -> address );
You can’t perform that action at this time.
0 commit comments