Author: Armin Rigo <[email protected]>
Branch: cpyext-ext
Changeset: r83073:7b7796d0cff0
Date: 2016-03-15 16:53 +0100
http://bitbucket.org/pypy/pypy/changeset/7b7796d0cff0/

Log:    Undo one of the effects of hacking at PyString_Type.tp_itemsize,
        which is that all PyStringObjects have the extra size allocated (but
        don't use it)

diff --git a/pypy/module/cpyext/pyobject.py b/pypy/module/cpyext/pyobject.py
--- a/pypy/module/cpyext/pyobject.py
+++ b/pypy/module/cpyext/pyobject.py
@@ -46,7 +46,7 @@
             size = pytype.c_tp_basicsize
         else:
             size = rffi.sizeof(self.basestruct)
-        if itemcount:
+        if itemcount and w_type is not space.w_str:
             size += itemcount * pytype.c_tp_itemsize
         assert size >= rffi.sizeof(PyObject.TO)
         buf = lltype.malloc(rffi.VOIDP.TO, size,
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to