Closed
Description
Currently a plain Python object has the following fields:
- values
- (managed) __dict__
- GC 1
- GC 2
- refcount
- __class__
- __weakrefs__
- WASTED
The WASTED
field is present because, due to alignment, we must allocate a multiple of 2 words.
We can reduce this to 6 by merging the values and __dict__ pointers into one (only one can be valid at any time),
and then moving the __weakrefs__ field into the empty space.
- __weakrefs__
- values or __dict__
- GC 1
- GC 2
- refcount
- __class__
See faster-cpython/ideas#125 for full discussion