Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 35.2k
gh-143300: implement PyUnstable_SetImmortal#144543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
b874f0bcb6cc99c897a08f00e23ff42377aed5389c9987a929a4003c8fe0fb5a146befe1ef13dFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Add :c:func:`PyUnstable_SetImmortal` C-API function to mark objects as :term:`immortal`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2839,6 +2839,17 @@ PyUnstable_EnableTryIncRef(PyObject *op) | ||
| #endif | ||
| } | ||
| int | ||
| PyUnstable_SetImmortal(PyObject *op) | ||
| { | ||
kumaraditya303 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| assert(op != NULL); | ||
| if (!_PyObject_IsUniquelyReferenced(op) || PyUnicode_Check(op)) { | ||
| return 0; | ||
| } | ||
| _Py_SetImmortal(op); | ||
kumaraditya303 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| return 1; | ||
| } | ||
| void | ||
| _Py_ResurrectReference(PyObject *op) | ||
| { | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.