Neil Schemenauer <nas-pyt...@arctrix.com> added the comment:

Updated patch is attached.  It appears that the extra item is only needed if 
Py_TPFLAGS_TYPE_SUBCLASS set.  In all other cases, it seems we don't need the 
extra space for the sentinel.  At least, the unit tests pass with this change.  
It could be that some extension module depends on this extra allocated spaced.

The number of types affected by this change seem relatively small.  The 'list' 
type is not affected because tp_itemsize is 0.  I did a little test by running 
some unit tests, here are some type names that have a smaller amount of memory 
allocated for them:

   _NamedIntConstant
   CodecInfo
   Point
   TestResults
   madtuple

----------
priority: normal -> low
stage:  -> patch review
Added file: https://bugs.python.org/file48404/generic_alloc_sentinel_v2.txt

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

Reply via email to