merge
[cython.git] / Cython / Compiler / Code.py
index cb279e07ce0bdb7c17aa2fdd70a674a26c137420..f6a702fd668188754a7a433507369bac5453d11c 100644 (file)
@@ -117,6 +117,7 @@ class FunctionState(object):
         self.temps_free = {} # (type, manage_ref) -> list of free vars with same type/managed status
         self.temps_used_type = {} # name -> (type, manage_ref)
         self.temp_counter = 0
+        self.closure_temps = None
 
     # labels
 
@@ -270,6 +271,9 @@ class FunctionState(object):
                 if manage_ref
                 for cname in freelist]
 
+    def init_closure_temps(self, scope):
+        self.closure_temps = ClosureTempAllocator(scope)
+
 
 class IntConst(object):
     """Global info about a Python integer constant held by GlobalState.
@@ -1397,7 +1401,7 @@ class PyrexCodeWriter(object):
 
 
 class ClosureTempAllocator(object):
-    def __init__(self, klass=None):
+    def __init__(self, klass):
         self.klass = klass
         self.temps_allocated = {}
         self.temps_free = {}