You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 12fca6c
Browse filesBrowse the repository at this point in the historyBrowse files
gh-162539: Add a pin count to ctypes objects and check it in resize()
ctypes.resize() can move or free an object's memory block while other
code still uses an address inside it. Add a pin count on the object
that owns the memory, helpers to pin and unpin it (atomic on the
free-threaded build), and make resize() raise BufferError while the
block is pinned.
This is groundwork only: nothing pins yet. Follow-up commits pin the
block during stores, for sub-objects, for exported buffers and for
pointers. The counter fits in existing padding, so objects do not
grow on 64-bit platforms.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments