• Kevin Modzelewski's avatar
    Match cpython's HEAPTYPE flag · 3b40ed33
    Kevin Modzelewski authored
    It's supposed to mean "whether this type is heap allocated", but
    it gets used as "is this a builtin/extension type".  We heap-allocate
    our builtin types so we were setting HEAPTYPE, but this keeps on
    causing issues.  I don't think anything actually uses HEAPTYPE to mean
    it's on the stack or heap, so let's just set them all to be HEAPTYPE=0.
    
    For better or worse, I ended up implementing this by changing the builtin
    types from BoxedHeapClasses to BoxedClasses, which seems to make sense.
    This had the effect of changing the existence of the tp_as_foo structs,
    which get automatically created for HeapClasses but not for non-heap classes.
    So most of the changes in this commit are trying to make sure that we
    have those when CPython has them.
    3b40ed33
builtins.cpp 59.5 KB