Author: mattip <[email protected]> Branch: cpyext-ext Changeset: r83875:88c3748b0de0 Date: 2016-04-22 17:12 +0300 http://bitbucket.org/pypy/pypy/changeset/88c3748b0de0/
Log: try to summarize IRC conversation diff --git a/pypy/module/cpyext/bytearrayobject.py b/pypy/module/cpyext/bytearrayobject.py --- a/pypy/module/cpyext/bytearrayobject.py +++ b/pypy/module/cpyext/bytearrayobject.py @@ -16,9 +16,12 @@ # For the convenience of C programmers, the bytes type is considered # to contain a char pointer, not an unsigned char pointer. -# XXX Since the ob_bytes is mutable, we must reflect the buffer back -# into the W_ByteArray object at each call to from_ref and each call to -# exported functions +# XXX The underlying data array is mutable, cpython gives direct access +# to ob_bytes as a RW pointer to bytes. How can we do this? +# One proposal is to make W_Bytearray.data into a nonmovable gc list +# as part of as_pyobj(), and expose data only through PyByteArray_AS_STRING +# Under this strategy ob_bytes could possibly not reflect the current state +# of the object PyByteArrayObjectStruct = lltype.ForwardReference() PyByteArrayObject = lltype.Ptr(PyByteArrayObjectStruct) _______________________________________________ pypy-commit mailing list [email protected] https://mail.python.org/mailman/listinfo/pypy-commit
