Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Currently a plain Python object has the following fields:
- values
- (managed) __dict__
- GC 1
- GC 2
- refcount
- __class__
- __weakrefs__
- WASTED
TheWASTED 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__
- valuesor __dict__
- GC 1
- GC 2
- refcount
- __class__
Seefaster-cpython/ideas#125 for full discussion