mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
gh-81057: Move More Globals in Core Code to _PyRuntimeState (gh-99516)
https://github.com/python/cpython/issues/81057
This commit is contained in:
parent
5cfb7d19f5
commit
5f55067e23
24 changed files with 241 additions and 130 deletions
|
@ -5,6 +5,36 @@
|
|||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
|
||||
struct pyhash_runtime_state {
|
||||
struct {
|
||||
#ifndef MS_WINDOWS
|
||||
int fd;
|
||||
dev_t st_dev;
|
||||
ino_t st_ino;
|
||||
#else
|
||||
// This is a placeholder so the struct isn't empty on Windows.
|
||||
int _not_used;
|
||||
#endif
|
||||
} urandom_cache;
|
||||
};
|
||||
|
||||
#ifndef MS_WINDOWS
|
||||
# define _py_urandom_cache_INIT \
|
||||
{ \
|
||||
.fd = -1, \
|
||||
}
|
||||
#else
|
||||
# define _py_urandom_cache_INIT {0}
|
||||
#endif
|
||||
|
||||
#define pyhash_state_INIT \
|
||||
{ \
|
||||
.urandom_cache = _py_urandom_cache_INIT, \
|
||||
}
|
||||
|
||||
|
||||
uint64_t _Py_KeyedHash(uint64_t, const char *, Py_ssize_t);
|
||||
|
||||
#endif
|
||||
|
||||
#endif // Py_INTERNAL_HASH_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue