> > > > Why is this? Wouldn't it be sufficient if views keep references > > to the 'viewed' byte object? > > > > They do, but the referenced "inner-thing" needs it's own reference count to > know how many "bytes-views" are sharing it. When a bytes-view gets cleaned > up, it decrefs the reference count of the inner-thing it is referring to, > and if the reference count goes to zero, the bytes-view calls the > destructor for the inner-thing. > Hm, I thought the 'inner-thing' is a python object (with it's own refcount) itself. Isn't the 'inner-thing' the bytes object owning the allocated memory? And the 'outer-things' (the views) simply viewing slices of this memory? Thomas
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4