8000 gh-104252: Immortalize Py_EMPTY_KEYS by ericsnowcurrently · Pull Request #104253 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-104252: Immortalize Py_EMPTY_KEYS #104253

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

Merged
Prev Previous commit
Next Next commit
Add a note.
  • Loading branch information
ericsnowcurrently committed May 8, 2023
commit f5da08808d8cc957989a9552ccdbf13897af9acc
8 changes: 6 additions & 2 deletions Objects/dictobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,12 @@ _PyDict_DebugMallocStats(FILE *out)

static void free_keys_object(PyInterpreterState *interp, PyDictKeysObject *keys);

// XXX Switch to Py_INCREF()?
/* We might consider modifying PyDictKeysObject so we could use
Py_INCREF() instead of dictkeys_incref() (and likewise with
Py_DECREF() and dictkeys_decref()). However, there doesn't
seem to be enough benefit (performance or otherwise) to justify
the change. */

static inline void
dictkeys_incref(PyDictKeysObject *dk)
{
Expand All @@ -313,7 +318,6 @@ dictkeys_incref(PyDictKeysObject *dk)
dk->dk_refcnt++;
}

// XXX Switch to Py_DECREF()?
static inline void
dictkeys_decref(PyInterpreterState *interp, PyDictKeysObject *dk)
{
Expand Down
0