Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
PyPy
pypy
Commits
2916967ae6c3
Commit
29a6d0d5
authored
Dec 09, 2022
by
Renaud Blanch
Browse files
only use pthread_jit_write_protect_np on arm64 + darwin
parent
24f682394df5
Pipeline
#59290
passed with stage
in 23 minutes and 45 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
rpython/rlib/rmmap.py
View file @
2916967a
...
...
@@ -24,6 +24,7 @@ _MS_WINDOWS = os.name == "nt"
_64BIT
=
"64bit"
in
platform
.
architecture
()[
0
]
_CYGWIN
=
"cygwin"
==
sys
.
platform
_DARWIN
=
"darwin"
==
sys
.
platform
_ARM64
=
"arm64"
==
platform
.
machine
()
class
RMMapError
(
Exception
):
def
__init__
(
self
,
message
):
...
...
@@ -60,7 +61,7 @@ if _POSIX:
constant_names
=
[
'MAP_SHARED'
,
'MAP_PRIVATE'
,
'MAP_FIXED'
,
'PROT_READ'
,
'PROT_WRITE'
,
'MS_SYNC'
]
if
sys
.
platform
==
'darwin'
:
if
_DARWIN
and
_ARM64
:
constant_names
.
append
(
'MAP_JIT'
)
opt_constant_names
=
[
'MAP_ANON'
,
'MAP_ANONYMOUS'
,
'MAP_NORESERVE'
,
'PROT_EXEC'
,
...
...
@@ -204,7 +205,7 @@ if _POSIX:
includes
=
includes
)
_get_allocation_granularity
=
_get_page_size
=
lambda
:
_pagesize
if
_DARWIN
:
if
_DARWIN
and
_ARM64
:
_
,
c_pthread_jit_write_protect_np
=
external
(
'pthread_jit_write_protect_np'
,
[
rffi
.
INT
],
lltype
.
Void
)
...
...
@@ -676,7 +677,7 @@ def _check_map_size(size):
if
size
<
0
:
raise
RTypeError
(
"memory mapped size must be positive"
)
if
_DARWIN
:
if
_DARWIN
and
_ARM64
:
class
Nester
(
object
):
def
__init__
(
self
):
...
...
@@ -784,7 +785,7 @@ if _POSIX:
def
alloc_hinted
(
hintp
,
map_size
):
flags
=
MAP_PRIVATE
|
MAP_ANONYMOUS
if
_DARWIN
:
if
_DARWIN
and
_ARM64
:
flags
|=
MAP_JIT
prot
=
PROT_EXEC
|
PROT_READ
|
PROT_WRITE
if
we_are_translated
():
...
...
Matti Picus
@mattip
mentioned in issue
#3865 (closed)
·
Dec 09, 2022
mentioned in issue
#3865 (closed)
mentioned in issue #3865
Toggle commit list
Write
Preview
Supports
Markdown
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