summaryrefslogtreecommitdiff
path: root/include/gc.h
diff options
context:
space:
mode:
authorJonathan Chambers <joncham@gmail.com>2018-02-01 11:53:34 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-02-01 11:53:34 +0300
commit5e73ff18487e2982f01dfc7913a62b77af7bc875 (patch)
tree9d8acf0a10a1ecca15b1788bc94114edf96d58e6 /include/gc.h
parentcd63cf1e82c933be0109ea7e75f21b0ee6aa11ae (diff)
downloadbdwgc-5e73ff18487e2982f01dfc7913a62b77af7bc875.tar.gz
Avoid SIGSEGV during GC_INIT on some Android devices
(part of commit 9379c66 from Unity-Technologies/bdwgc) Issue #173 (bdwgc). * include/gc.h [(HOST_ANDROID || __ANDROID__) && !GC_NOT_DLL] (GC_INIT_CONF_ROOTS): Define to empty unless IGNORE_DYNAMIC_LOADING; add comment.
Diffstat (limited to 'include/gc.h')
-rw-r--r--include/gc.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/gc.h b/include/gc.h
index 3f7c9d52..f206cf8c 100644
--- a/include/gc.h
+++ b/include/gc.h
@@ -1833,7 +1833,11 @@ GC_API int GC_CALL GC_get_force_unmap_on_gcollect(void);
# define GC_DATAEND ((void *)((ulong)_end))
# define GC_INIT_CONF_ROOTS GC_add_roots(GC_DATASTART, GC_DATAEND)
#elif (defined(HOST_ANDROID) || defined(__ANDROID__)) \
- && !defined(GC_NOT_DLL)
+ && !defined(GC_NOT_DLL) && defined(IGNORE_DYNAMIC_LOADING)
+ /* It causes the entire binary section of memory be pushed as a root. */
+ /* This might be a bad idea though because on some Android devices */
+ /* some of the binary data might become unmapped thus causing SIGSEGV */
+ /* with code SEGV_MAPERR. */
# pragma weak _etext
# pragma weak __data_start
# pragma weak __dso_handle