GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-43503: Make limited API objects effectively immutable. by ericsnowcurrently · Pull Request #24828 · python/cpython

bpo-43503: Make limited API objects effectively immutable. #24828

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.

Sign up for GitHub

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

Closed
ericsnowcurrently wants to merge 16 commits into python:master from ericsnowcurrently:globals-immortal-objects-flags

Uh oh!

There was an error while loading. Please reload this page.

Closed

bpo-43503: Make limited API objects effectively immutable. #24828

Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
4951703
Add support for immortal objects (large neg int means "immortal").
ericsnowcurrently Dec 10, 2020
4b1eea3
Switch to a positive number.
ericsnowcurrently Dec 10, 2020
a34f285
Add Py_IMMORTAL_CONST_REFCOUNTS.
ericsnowcurrently Dec 10, 2020
3966551
Add a NEWS entry.
ericsnowcurrently Mar 11, 2021
1a3b4da
Add docs.
ericsnowcurrently Mar 11, 2021
728f24b
Drop special handling of negative refcounts.
ericsnowcurrently Mar 11, 2021
2536e8b
Do not reset the refcount in _PyObject_IsImmortal().
ericsnowcurrently Mar 11, 2021
518e9e8
Do not allow immortal objects in the limited API.
ericsnowcurrently Mar 11, 2021
277e1ea
Do not re-declare _PyObject_IsImmortal.
ericsnowcurrently Mar 11, 2021
edef342
Go back to using Py_SET_REFCNT() in _Py_NewReference().
ericsnowcurrently Mar 12, 2021
4d22e00
Fix an accidental line removal.
ericsnowcurrently Mar 12, 2021
838f88f
Add more comments and drop the internal-only macros from the docs.
ericsnowcurrently Mar 12, 2021
00948a0
Drop a holdover from immortal objects with negative refcounts.
ericsnowcurrently Mar 15, 2021
00504d9
Move _Py_SET_REFCNT() out of the header file.
ericsnowcurrently Mar 15, 2021
e6fc84f
Define _py_is_immortal() only for Py_IMMORTAL_CONST_REFCOUNTS.
ericsnowcurrently Mar 15, 2021
f103804
Drop Py_IMMORTAL_CONST_REFCOUNTS and make immortal objects internal.
ericsnowcurrently Mar 12, 2021
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
Do not allow immortal objects in the limited API.
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@ericsnowcurrently
ericsnowcurrently committed Mar 12, 2021
commit 518e9e84f6eee25be38369ea48825620fa68b953

There are no files selected for viewing

6 changes: 6 additions & 0 deletions 6 Include/object.h
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,12 @@ times.
#endif


#if defined(Py_LIMITED_API) && \
(defined(_Py_IMMORTAL_OBJECTS) || defined(Py_IMMORTAL_CONST_REFCOUNTS))
#error "the immortal objects API is not available in the limited API"
#endif


static inline int
PyType_HasFeature(PyTypeObject *type, unsigned long feature)
{
Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.