GH-125174: Mark objects as statically allocated. by markshannon · Pull Request #127797 · python/cpython
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM. I've left a couple of minor comments. This will be a nice improvement.
Out of curiosity, how disruptive is adding a new field to the object structure?
It doesn't change the size of the PyObject struct or the offsets of ob_refcnt and ob_type.
Changing any of those would be very disruptive.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| #if SIZEOF_VOID_P > 4 | ||
| /* If an object has been freed, it will have a negative full refcnt | ||
| * If it has not it been freed, will have a very large refcnt */ | ||
| if (op->ob_refcnt_full <= 0 || op->ob_refcnt > (UINT32_MAX - (1<<20))) { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently UINT32_MAX is not defined in all builds, so this breaks a buildbot.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use UINT32_MAX all over the place, so it must be defined. Maybe we're missing a #include somewhere.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's a C++ build that failing, which might explain it
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mpage
mentioned this pull request
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request
