Debian Codegraph @

Include/internal/pycore_dict_state.h

raw
1 #ifndef Py_INTERNAL_DICT_STATE_H
2 #define Py_INTERNAL_DICT_STATE_H
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6
7 #ifndef Py_BUILD_CORE
8 # error "this header requires Py_BUILD_CORE define"
9 #endif
10
11 #define DICT_MAX_WATCHERS 8
12 #define DICT_WATCHED_MUTATION_BITS 4
13
14 struct _Py_dict_state {
15 uint32_t next_keys_version;
16 PyMutex watcher_mutex; // Protects the watchers array (free-threaded builds)
17 _PyOnceFlag watcher_setup_once; // One-time optimizer watcher setup
18 PyDict_WatchCallback watchers[DICT_MAX_WATCHERS];
19 };
20
21 #define _dict_state_INIT \
22 { \
23 .next_keys_version = 2, \
24 }
25
26
27 #ifdef __cplusplus
28 }
29 #endif
30 #endif /* !Py_INTERNAL_DICT_STATE_H */