[pypy-commit] pypy minimark-noclear: in-progress

arigo noreply at buildbot.pypy.org
Tue Aug 28 22:47:13 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: minimark-noclear
Changeset: r56911:6a386a83fd27
Date: 2012-08-28 22:45 +0200
http://bitbucket.org/pypy/pypy/changeset/6a386a83fd27/

Log:	in-progress

diff --git a/pypy/jit/metainterp/gc.py b/pypy/jit/metainterp/gc.py
--- a/pypy/jit/metainterp/gc.py
+++ b/pypy/jit/metainterp/gc.py
@@ -3,6 +3,7 @@
 """
 
 class GcDescription:
+    malloc_varsize_zero_filled = True
     def __init__(self, config):
         self.config = config
 
@@ -23,7 +24,7 @@
     malloc_zero_filled = True
 
 class GC_minimark(GcDescription):
-    malloc_zero_filled = True
+    malloc_zero_filled = False
 
 
 def get_description(config):
diff --git a/pypy/rlib/objectmodel.py b/pypy/rlib/objectmodel.py
--- a/pypy/rlib/objectmodel.py
+++ b/pypy/rlib/objectmodel.py
@@ -263,6 +263,7 @@
         return lltype.Signed
 
 malloc_zero_filled = CDefinedIntSymbolic('MALLOC_ZERO_FILLED', default=0)
+malloc_varsize_zero_filled = True      # always True for now
 running_on_llinterp = CDefinedIntSymbolic('RUNNING_ON_LLINTERP', default=1)
 # running_on_llinterp is meant to have the value 0 in all backends
 
diff --git a/pypy/rpython/lltypesystem/rstr.py b/pypy/rpython/lltypesystem/rstr.py
--- a/pypy/rpython/lltypesystem/rstr.py
+++ b/pypy/rpython/lltypesystem/rstr.py
@@ -2,7 +2,7 @@
 from pypy.tool.pairtype import pairtype
 from pypy.annotation import model as annmodel
 from pypy.rpython.error import TyperError
-from pypy.rlib.objectmodel import malloc_zero_filled, we_are_translated
+from pypy.rlib.objectmodel import malloc_varsize_zero_filled, we_are_translated
 from pypy.rlib.objectmodel import _hash_string, enforceargs
 from pypy.rlib.objectmodel import keepalive_until_here, specialize
 from pypy.rlib.debug import ll_assert
@@ -39,7 +39,7 @@
     def mallocstr(length):
         ll_assert(length >= 0, "negative string length")
         r = malloc(TP, length)
-        if not we_are_translated() or not malloc_zero_filled:
+        if not we_are_translated() or not malloc_varsize_zero_filled:
             r.hash = 0
         return r
     mallocstr._annspecialcase_ = 'specialize:semierased'
diff --git a/pypy/rpython/rlist.py b/pypy/rpython/rlist.py
--- a/pypy/rpython/rlist.py
+++ b/pypy/rpython/rlist.py
@@ -7,7 +7,7 @@
 from pypy.rpython.lltypesystem.lltype import typeOf, Ptr, Void, Signed, Bool
 from pypy.rpython.lltypesystem.lltype import nullptr, Char, UniChar, Number
 from pypy.rpython import robject
-from pypy.rlib.objectmodel import malloc_zero_filled
+from pypy.rlib.objectmodel import malloc_varsize_zero_filled
 from pypy.rlib.debug import ll_assert
 from pypy.rlib.rarithmetic import ovfcheck, widen, r_uint, intmask
 from pypy.rpython.annlowlevel import ADTInterface
@@ -502,8 +502,9 @@
         check = widen(item)
     else:
         check = item
-    if (not malloc_zero_filled) or check: # as long as malloc it is known to zero the allocated memory avoid zeroing twice
-
+    if (not malloc_varsize_zero_filled) or check:
+        # as long as malloc_varsize is known to zero the allocated memory,
+        # avoid zeroing twice
         i = 0
         while i < count:
             l.ll_setitem_fast(i, item)


More information about the pypy-commit mailing list