[issue26753] Obmalloc lock LOCK_INIT and LOCK_FINI are never used

Larry Hastings report at bugs.python.org
Sat Apr 16 04:43:10 EDT 2016


Larry Hastings added the comment:

Patch attached.  The basics were okay; however, there was no locking around access to a static variable (_Py_AllocatedBlocks) so I added some.  The way the code managed _Py_AllocatedBlocks was a bit odd; this approach resulted in fewer lines, but it was hard to follow, and adding locking support would have muddied it even further, so I simplified it.  I also simplified the locking support a great deal ("SIMPLELOCK": YAGNI) and touched up the relevant comment.

Finally, I noticed a minor bug wrt added _Py_AllocatedBlocks: if you call PyMem_Realloc(NULL, 50000), that's really a new allocation, so _Py_AllocatedBlocks needs to be incremented, but it wasn't.  Since Antoine is the father of _Py_AllocatedBlocks I added him to the nosy list.

----------
nosy: +pitrou

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26753>
_______________________________________


More information about the Python-bugs-list mailing list