Author: Brian Kearns <bdkea...@gmail.com>
Branch: 
Changeset: r69513:e2df1b135323
Date: 2014-02-27 07:16 -0500
http://bitbucket.org/pypy/pypy/changeset/e2df1b135323/

Log:    merge heads

diff --git a/include/PyPy.h b/include/PyPy.h
--- a/include/PyPy.h
+++ b/include/PyPy.h
@@ -8,16 +8,12 @@
 extern "C" {
 #endif
 
-/* You should call this first once. */
-#define pypy_init(need_threads) do { pypy_asm_stack_bottom();  \
-rpython_startup_code();\
- if (need_threads) pypy_init_threads(); } while (0)
+// call this first
+char* rpython_startup_code(void);
 
-// deprecated interface
-void rpython_startup_code(void);
+// pypy_init_threads has to be called in case you want to use threads
 void pypy_init_threads(void);
 
-
 /* Initialize the home directory of PyPy.  It is necessary to call this.
 
    Call it with "home" being the file name of the libpypy.so, for
diff --git a/pypy/doc/embedding.rst b/pypy/doc/embedding.rst
--- a/pypy/doc/embedding.rst
+++ b/pypy/doc/embedding.rst
@@ -14,12 +14,15 @@
 to make a full API working, provided you'll follow a few principles. The API
 is:
 
-.. function:: void pypy_init(int need_threads);
+.. function:: char* rpython_startup_code(void);
 
    This is a function that you have to call (once) before calling anything.
    It initializes the RPython/PyPy GC and does a bunch of necessary startup
-   code. This function cannot fail. Pass 1 in case you need thread support, 0
-   otherwise.
+   code. This function cannot fail and always returns NULL.
+
+.. function:: void pypy_init_threads(void);
+
+   Initialize threads. Only need to be called if there are any threads involved
 
 .. function:: long pypy_setup_home(char* home, int verbose);
 
@@ -46,7 +49,7 @@
    In case your application uses threads that are initialized outside of PyPy,
    you need to call this function to tell the PyPy GC to track this thread.
    Note that this function is not thread-safe itself, so you need to guard it
-   with a mutex. Do not call it from the main thread.
+   with a mutex.
 
 Simple example
 --------------
diff --git a/pypy/goal/targetpypystandalone.py 
b/pypy/goal/targetpypystandalone.py
--- a/pypy/goal/targetpypystandalone.py
+++ b/pypy/goal/targetpypystandalone.py
@@ -80,7 +80,7 @@
     # 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
+    from rpython.rlib.entrypoint import entrypoint, RPython_StartupCode
     from rpython.rtyper.lltypesystem import rffi, lltype
     from rpython.rtyper.lltypesystem.lloperation import llop
 
@@ -94,7 +94,6 @@
     @entrypoint('main', [rffi.CCHARP, rffi.INT], c_name='pypy_setup_home')
     def pypy_setup_home(ll_home, verbose):
         from pypy.module.sys.initpath import pypy_find_stdlib
-        llop.gc_stack_bottom(lltype.Void)
         verbose = rffi.cast(lltype.Signed, verbose)
         if ll_home:
             home = rffi.charp2str(ll_home)
@@ -124,7 +123,6 @@
     def pypy_execute_source(ll_source):
         after = rffi.aroundstate.after
         if after: after()
-        llop.gc_stack_bottom(lltype.Void)
         source = rffi.charp2str(ll_source)
         res = _pypy_execute_source(source)
         before = rffi.aroundstate.before
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to