Author: wenzhuman <[email protected]>
Branch: gc_no_cleanup_nursery
Changeset: r72249:96df1fcb42a2
Date: 2014-06-26 17:56 -0400
http://bitbucket.org/pypy/pypy/changeset/96df1fcb42a2/

Log:    remove the zero flag and passed all the tests under
        rpython/memory/test

diff --git a/rpython/memory/gc/base.py b/rpython/memory/gc/base.py
--- a/rpython/memory/gc/base.py
+++ b/rpython/memory/gc/base.py
@@ -133,6 +133,8 @@
         """For testing.  The interface used by the gctransformer is
         the four malloc_[fixed,var]size[_clear]() functions.
         """
+        #TODO:check if the zero flag is unuseful now. If so, remove it
+        
         # Rules about fallbacks in case of missing malloc methods:
         #  * malloc_fixedsize_clear() and malloc_varsize_clear() are mandatory
         #  * malloc_fixedsize() and malloc_varsize() fallback to the above
@@ -149,14 +151,14 @@
             assert not needs_finalizer
             itemsize = self.varsize_item_sizes(typeid)
             offset_to_length = self.varsize_offset_to_length(typeid)
-            if zero and not hasattr(self, 'malloc_varsize'):
+            if not hasattr(self, 'malloc_varsize'):
                 malloc_varsize = self.malloc_varsize_clear
             else:
                 malloc_varsize = self.malloc_varsize
             ref = malloc_varsize(typeid, length, size, itemsize,
                                  offset_to_length)
         else:
-            if zero and not hasattr(self, 'malloc_fixedsize'):
+            if not hasattr(self, 'malloc_fixedsize'):
                 malloc_fixedsize = self.malloc_fixedsize_clear
             else:
                 malloc_fixedsize = self.malloc_fixedsize
diff --git a/rpython/memory/gctransform/framework.py 
b/rpython/memory/gctransform/framework.py
--- a/rpython/memory/gctransform/framework.py
+++ b/rpython/memory/gctransform/framework.py
@@ -665,15 +665,12 @@
                                                   has_light_finalizer)
 
         if not op.opname.endswith('_varsize') and not flags.get('varsize'):
+            #TODO:check if it's safe to remove the zero-flag
             zero = flags.get('zero', False)
             if (self.malloc_fast_ptr is not None and
                 not c_has_finalizer.value and
                 (self.malloc_fast_is_clearing or not zero)):
                 malloc_ptr = self.malloc_fast_ptr
-            
-            #elif zero:
-                #malloc_ptr = self.malloc_fixedsize_clear_ptr
-            
             else:
                 malloc_ptr = self.malloc_fixedsize_ptr
             args = [self.c_const_gc, c_type_id, c_size,
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to