Author: Matti Picus <matti.pi...@gmail.com> Branch: py3.6 Changeset: r96108:b7734909be86 Date: 2019-02-20 10:12 +0200 http://bitbucket.org/pypy/pypy/changeset/b7734909be86/
Log: merge default into branch 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 @@ -1052,16 +1052,20 @@ i += 1 return s.build(), i -def utf82wcharp(utf8, utf8len): +def utf82wcharp(utf8, utf8len, track_allocation=True): from rpython.rlib import rutf8 - w = lltype.malloc(CWCHARP.TO, utf8len + 1, flavor='raw') + if track_allocation: + w = lltype.malloc(CWCHARP.TO, utf8len + 1, flavor='raw', track_allocation=True) + else: + w = lltype.malloc(CWCHARP.TO, utf8len + 1, flavor='raw', track_allocation=False) index = 0 for ch in rutf8.Utf8StringIterator(utf8): w[index] = unichr(ch) index += 1 w[index] = unichr(0) return w +utf82charp._annenforceargs_ = [str, int, bool] # char** CCHARPP = lltype.Ptr(lltype.Array(CCHARP, hints={'nolength': True})) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit