8000 gh-90111: Minor Cleanup for Runtime-Global Objects by ericsnowcurrently · Pull Request #100254 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-90111: Minor Cleanup for Runtime-Global Objects #100254

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
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Move the interned dict from _PyRuntime.global_objects to _PyRuntime.c…
…ached_objects.
  • Loading branch information
ericsnowcurrently committed Dec 14, 2022
commit c4dbfb5bb8948ed640e973d8cd5c07633a3d35ce
4 changes: 2 additions & 2 deletions Include/internal/pycore_global_objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ extern "C" {

struct _Py_cached_objects {
PyObject *str_replace_inf;

PyObject *interned;
};

#define _Py_GLOBAL_OBJECT(NAME) \
Expand Down Expand Up @@ -59,8 +61,6 @@ struct _Py_global_objects {
PyHamtNode_Bitmap hamt_bitmap_node_empty;
_PyContextTokenMissing context_token_missing;
} singletons;

PyObject *interned;
};

#define _Py_INTERP_CACHED_OBJECT(interp, NAME) \
Expand Down
4 changes: 2 additions & 2 deletions Objects/unicodeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,12 @@ static inline PyObject* unicode_new_empty(void)
*/
static inline PyObject *get_interned_dict(void)
{
return _PyRuntime.global_objects.interned;
return _PyRuntime.cached_objects.interned;
}

static inline void set_interned_dict(PyObject *dict)
{
_PyRuntime.global_objects.interned = dict;
_PyRuntime.cached_objects.interned = dict;
}

#define _Py_RETURN_UNICODE_EMPTY() \
Expand Down
0