[pypy-commit] pypy default: use 0 as a default for stack number and increase it by 1 when running main

fijal noreply at buildbot.pypy.org
Sun May 12 14:20:13 CEST 2013


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r64005:e757f9bffff3
Date: 2013-05-12 14:19 +0200
http://bitbucket.org/pypy/pypy/changeset/e757f9bffff3/

Log:	use 0 as a default for stack number and increase it by 1 when
	running main

diff --git a/rpython/rtyper/lltypesystem/rffi.py b/rpython/rtyper/lltypesystem/rffi.py
--- a/rpython/rtyper/lltypesystem/rffi.py
+++ b/rpython/rtyper/lltypesystem/rffi.py
@@ -329,8 +329,9 @@
 
 class StackCounter:
     def _cleanup_(self):
-        self.stacks_counter = 1     # number of "stack pieces": callbacks
+        self.stacks_counter = 0     # number of "stack pieces": callbacks
                                     # and threads increase it by one
+
 stackcounter = StackCounter()
 stackcounter._cleanup_()
 
diff --git a/rpython/translator/c/src/entrypoint.c b/rpython/translator/c/src/entrypoint.c
--- a/rpython/translator/c/src/entrypoint.c
+++ b/rpython/translator/c/src/entrypoint.c
@@ -20,12 +20,20 @@
 int pypy_main_function(int argc, char *argv[]) __attribute__((__noinline__));
 #endif
 
+# ifdef PYPY_USE_ASMGCC
+#  include "structdef.h"
+#  include "forwarddecl.h"
+# endif
+
 int pypy_main_function(int argc, char *argv[])
 {
     char *errmsg;
     int i, exitcode;
     RPyListOfString *list;
 
+#ifdef PYPY_USE_ASMGCC
+    pypy_g_rpython_rtyper_lltypesystem_rffi_StackCounter.sc_inst_stacks_counter++;
+#endif
     pypy_asm_stack_bottom();
 #ifdef PYPY_X86_CHECK_SSE2_DEFINED
     pypy_x86_check_sse2();


More information about the pypy-commit mailing list