Message235211
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? |
|
Date |
User |
Action |
Args |
2015-02-01 22:13:01 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, belopolsky, pitrou, larry, Arfrever, skrah, martin.panter |
2015-02-01 22:13:01 | serhiy.storchaka | set | messageid: <1422828781.74.0.0703292308184.issue22896@psf.upfronthosting.co.za> |
2015-02-01 22:13:01 | serhiy.storchaka | link | issue22896 messages |
2015-02-01 22:13:01 | serhiy.storchaka | create | |
|