Author: Maciej Fijalkowski <fij...@gmail.com> Branch: Changeset: r74351:34433ac979df Date: 2014-11-06 08:38 +0200 http://bitbucket.org/pypy/pypy/changeset/34433ac979df/
Log: use the official way to malloc strings, fixes issue1919 diff --git a/rpython/rtyper/lltypesystem/rffi.py b/rpython/rtyper/lltypesystem/rffi.py --- a/rpython/rtyper/lltypesystem/rffi.py +++ b/rpython/rtyper/lltypesystem/rffi.py @@ -825,7 +825,7 @@ allows for the process to be performed without an extra copy. Make sure to call keep_buffer_alive_until_here on the returned values. """ - new_buf = lltype.malloc(STRTYPE, count) + new_buf = mallocfn(count) pinned = 0 if rgc.can_move(new_buf): if rgc.pin(new_buf): @@ -857,7 +857,7 @@ if llop.shrink_array(lltype.Bool, gc_buf, needed_size): pass # now 'gc_buf' is smaller else: - gc_buf = lltype.malloc(STRTYPE, needed_size) + gc_buf = mallocfn(needed_size) case_num = 2 if case_num == 2: copy_raw_to_string(raw_buf, gc_buf, 0, needed_size) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit