[pypy-svn] r70883 - pypy/branch/stringbuilder2/pypy/rpython/lltypesystem
arigo at codespeak.net
arigo at codespeak.net
Tue Jan 26 15:17:39 CET 2010
Author: arigo
Date: Tue Jan 26 15:17:38 2010
New Revision: 70883
Modified:
pypy/branch/stringbuilder2/pypy/rpython/lltypesystem/rbuilder.py
Log:
Fix for test_rbuilder: always use mallocstr/mallocunicode.
Modified: pypy/branch/stringbuilder2/pypy/rpython/lltypesystem/rbuilder.py
==============================================================================
--- pypy/branch/stringbuilder2/pypy/rpython/lltypesystem/rbuilder.py (original)
+++ pypy/branch/stringbuilder2/pypy/rpython/lltypesystem/rbuilder.py Tue Jan 26 15:17:38 2010
@@ -59,7 +59,7 @@
ll_builder = lltype.malloc(cls.lowleveltype.TO)
ll_builder.allocated = init_size
ll_builder.used = 0
- ll_builder.buf = lltype.malloc(cls.basetp, init_size)
+ ll_builder.buf = cls.mallocfn(init_size)
return ll_builder
@staticmethod
@@ -110,12 +110,14 @@
class StringBuilderRepr(BaseStringBuilderRepr):
lowleveltype = lltype.Ptr(STRINGBUILDER)
basetp = STR
+ mallocfn = staticmethod(rstr.mallocstr)
string_repr = string_repr
char_repr = char_repr
class UnicodeBuilderRepr(BaseStringBuilderRepr):
lowleveltype = lltype.Ptr(UNICODEBUILDER)
basetp = UNICODE
+ mallocfn = staticmethod(rstr.mallocunicode)
string_repr = unicode_repr
char_repr = unichar_repr
More information about the Pypy-commit
mailing list