Author: Armin Rigo <[email protected]>
Branch: tealet
Changeset: r45384:4ededdcb373f
Date: 2011-06-12 16:01 +0200
http://bitbucket.org/pypy/pypy/changeset/4ededdcb373f/

Log:    Move initialization to the class declaration. Needed anyway because
        otherwise W_Tealet is missing these attributes.

diff --git a/pypy/rlib/rtealet.py b/pypy/rlib/rtealet.py
--- a/pypy/rlib/rtealet.py
+++ b/pypy/rlib/rtealet.py
@@ -22,6 +22,8 @@
 
     class Tealet(base_class):
         lltealet = _tealet_rffi.NULL_TEALET
+        _gc_gcptr_array  = lltype.nullptr(GCPTR_ARRAY.TO)
+        _gc_signed_array = lltype.nullptr(SIGNED_ARRAY.TO)
 
         def switch(self):
             _switch(self)
@@ -47,8 +49,6 @@
 
     return Tealet, MainTealet
 
-Tealet, MainTealet = _make_classes(object)
-
 ## ------------------------------------------------------------
 ## The code below is implementation details.
 
@@ -150,9 +150,6 @@
                                         ('signed_array', SIGNED_ARRAY)))
 walker = lltype.malloc(WALKER_PTR.TO, immortal=True)
 
-Tealet._gc_gcptr_array  = lltype.nullptr(GCPTR_ARRAY.TO)
-Tealet._gc_signed_array = lltype.nullptr(SIGNED_ARRAY.TO)
-
 def _save_shadow_stack():
     llop.gc_save_stack_roots(lltype.Void, walker)
     tealet = switcher.current
@@ -174,3 +171,7 @@
     walker.gcptr_array  = lltype.nullptr(GCPTR_ARRAY.TO)
     walker.signed_array = lltype.nullptr(SIGNED_ARRAY.TO)
 _restore_shadow_stack._dont_inline_ = True
+
+# ____________________________________________________________
+
+Tealet, MainTealet = _make_classes(object)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to