projects
/
platform
/
upstream
/
dotnet
/
runtime.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dbacdc2
)
[runtime] Allocate code memory using MAP_JIT on apple silicon, patching code randomly...
author
monojenkins
<jo.shields+jenkins@xamarin.com>
Thu, 3 Sep 2020 21:56:36 +0000
(17:56 -0400)
committer
GitHub
<noreply@github.com>
Thu, 3 Sep 2020 21:56:36 +0000
(17:56 -0400)
Co-authored-by: vargaz <vargaz@users.noreply.github.com>
src/mono/mono/utils/mono-mmap.c
patch
|
blob
|
history
diff --git
a/src/mono/mono/utils/mono-mmap.c
b/src/mono/mono/utils/mono-mmap.c
index
2dff889
..
fa4686f
100644
(file)
--- a/
src/mono/mono/utils/mono-mmap.c
+++ b/
src/mono/mono/utils/mono-mmap.c
@@
-305,6
+305,9
@@
mono_valloc (void *addr, size_t length, int flags, MonoMemAccountType type)
}
if ((flags & MONO_MMAP_JIT) && (use_mmap_jit || is_hardened_runtime == 1))
mflags |= MAP_JIT;
+ /* Patching code on apple silicon seems to cause random crashes without this flag */
+ if (__builtin_available (macOS 11, *))
+ mflags |= MAP_JIT;
}
#endif