aboutsummaryrefslogtreecommitdiff
path: root/pypy/goal
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2016-12-17 14:10:46 +0100
committerArmin Rigo <arigo@tunes.org>2016-12-17 14:10:46 +0100
commit2d6211020d0b48546f0a839bcdb7330ce00ee71e (patch)
tree0e5a8cf10d0ca53c3b63953e10223fe120714465 /pypy/goal
parentTry to import 'embedding' from __init__(), which might allow us (diff)
downloadpypy-2d6211020d0b48546f0a839bcdb7330ce00ee71e.tar.gz
pypy-2d6211020d0b48546f0a839bcdb7330ce00ee71e.tar.bz2
pypy-2d6211020d0b48546f0a839bcdb7330ce00ee71e.zip
Add the config option 'disable_entrypoints' for embedding PyPy together
with another RPython VM
Diffstat (limited to 'pypy/goal')
-rw-r--r--pypy/goal/targetpypystandalone.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/pypy/goal/targetpypystandalone.py b/pypy/goal/targetpypystandalone.py
index 13c4561dc9..998b92d85e 100644
--- a/pypy/goal/targetpypystandalone.py
+++ b/pypy/goal/targetpypystandalone.py
@@ -83,12 +83,18 @@ def create_entry_point(space, w_dict):
return 1
return exitcode
+ return entry_point, get_additional_entrypoints(space)
+
+
+def get_additional_entrypoints(space):
# register the minimal equivalent of running a small piece of code. This
# should be used as sparsely as possible, just to register callbacks
-
from rpython.rlib.entrypoint import entrypoint_highlevel
from rpython.rtyper.lltypesystem import rffi, lltype
+ if space.config.objspace.disable_entrypoints:
+ return {}
+
@entrypoint_highlevel('main', [rffi.CCHARP, rffi.INT],
c_name='pypy_setup_home')
def pypy_setup_home(ll_home, verbose):
@@ -188,11 +194,11 @@ def create_entry_point(space, w_dict):
return -1
return 0
- return entry_point, {'pypy_execute_source': pypy_execute_source,
- 'pypy_execute_source_ptr': pypy_execute_source_ptr,
- 'pypy_init_threads': pypy_init_threads,
- 'pypy_thread_attach': pypy_thread_attach,
- 'pypy_setup_home': pypy_setup_home}
+ return {'pypy_execute_source': pypy_execute_source,
+ 'pypy_execute_source_ptr': pypy_execute_source_ptr,
+ 'pypy_init_threads': pypy_init_threads,
+ 'pypy_thread_attach': pypy_thread_attach,
+ 'pypy_setup_home': pypy_setup_home}
# _____ Define and setup target ___