Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
cd83fa8c
Commit
cd83fa8c
authored
Jun 27, 2013
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #13483: Use VirtualAlloc in obmalloc on Windows.
parent
fe3ae3cd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
Misc/NEWS
Misc/NEWS
+2
-0
Objects/obmalloc.c
Objects/obmalloc.c
+12
-2
No files found.
Misc/NEWS
View file @
cd83fa8c
...
...
@@ -10,6 +10,8 @@ What's New in Python 3.4.0 Alpha 1?
Core and Builtins
-----------------
- Issue #13483: Use VirtualAlloc in obmalloc on Windows.
- Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise
OverflowError when an argument of %c format is out of range.
...
...
Objects/obmalloc.c
View file @
cd83fa8c
...
...
@@ -9,6 +9,10 @@
#endif
#endif
#ifdef MS_WINDOWS
#include <windows.h>
#endif
#ifdef WITH_VALGRIND
#include <valgrind/valgrind.h>
...
...
@@ -598,7 +602,11 @@ new_arena(void)
arenaobj
=
unused_arena_objects
;
unused_arena_objects
=
arenaobj
->
nextarena
;
assert
(
arenaobj
->
address
==
0
);
#ifdef ARENAS_USE_MMAP
#ifdef MS_WINDOWS
address
=
(
void
*
)
VirtualAlloc
(
NULL
,
ARENA_SIZE
,
MEM_COMMIT
|
MEM_RESERVE
,
PAGE_READWRITE
);
err
=
(
address
==
NULL
);
#elif defined(ARENAS_USE_MMAP)
address
=
mmap
(
NULL
,
ARENA_SIZE
,
PROT_READ
|
PROT_WRITE
,
MAP_PRIVATE
|
MAP_ANONYMOUS
,
-
1
,
0
);
err
=
(
address
==
MAP_FAILED
);
...
...
@@ -1093,7 +1101,9 @@ PyObject_Free(void *p)
unused_arena_objects
=
ao
;
/* Free the entire arena. */
#ifdef ARENAS_USE_MMAP
#ifdef MS_WINDOWS
VirtualFree
((
void
*
)
ao
->
address
,
0
,
MEM_RELEASE
);
#elif defined(ARENAS_USE_MMAP)
munmap
((
void
*
)
ao
->
address
,
ARENA_SIZE
);
#else
free
((
void
*
)
ao
->
address
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment