Commits

Maciej Fijalkowski committed e757f9b

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

Comments (0)

Files changed (2)

rpython/rtyper/lltypesystem/rffi.py

 
 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_()
 

rpython/translator/c/src/entrypoint.c

 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();