Author serhiy.storchaka
Recipients Arfrever, belopolsky, larry, martin.panter, pitrou, serhiy.storchaka, skrah
Date 2015-02-01.22:13:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1422828781.74.0.0703292308184.issue22896@psf.upfronthosting.co.za>
In-reply-to
Content
from_buffer() uses a memory buffer of other object. It keeps a reference to the object to prevent deallocation of memory when there will be no more external references. But this doesn't prevent from reallocating of memory of living object (e.g. for resizing of bytearray). So we need to grab the buffer (with PyObject_GetBuffer) in from_buffer() and free it (with PyBuffer_Release) when it is no longer needed. menoryview can do this but needs a hack, because a memoryview created by PyMemoryView_FromBuffer() doesn't release the buffer. May be there is more official way?
History
Date User Action Args
2015-02-01 22:13:01serhiy.storchakasetrecipients: + serhiy.storchaka, belopolsky, pitrou, larry, Arfrever, skrah, martin.panter
2015-02-01 22:13:01serhiy.storchakasetmessageid: <1422828781.74.0.0703292308184.issue22896@psf.upfronthosting.co.za>
2015-02-01 22:13:01serhiy.storchakalinkissue22896 messages
2015-02-01 22:13:01serhiy.storchakacreate