Dino Viehland <dinoviehl...@gmail.com> added the comment:

The PR actually checks that the buffer is read-only (this was also a concern 
that Mark Shannon had).  And the Python buffer protocol says that you need to 
consistently hand out read-only buffers.  So while someone could create a 
buffer and mutate it outside of the buffer protocol it should be really 
read-only.  

As far as the ref counts, it's not just the ref counts for the code byte 
strings that are potentially problematic.  But it's the ref counts on all of 
the random other objects which the code objects are on the same page as, as 
well as other random read-write data that could be on those pages.  There's 
also an additional benefit in that code objects not loaded before forking can 
continue to share their memory as well.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36839>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to