Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:18:06

0001 #ifndef Py_INTERNAL_DICT_STATE_H
0002 #define Py_INTERNAL_DICT_STATE_H
0003 #ifdef __cplusplus
0004 extern "C" {
0005 #endif
0006 
0007 #ifndef Py_BUILD_CORE
0008 #  error "this header requires Py_BUILD_CORE define"
0009 #endif
0010 
0011 
0012 #ifndef WITH_FREELISTS
0013 // without freelists
0014 #  define PyDict_MAXFREELIST 0
0015 #endif
0016 
0017 #ifndef PyDict_MAXFREELIST
0018 #  define PyDict_MAXFREELIST 80
0019 #endif
0020 
0021 #define DICT_MAX_WATCHERS 8
0022 
0023 struct _Py_dict_state {
0024     /*Global counter used to set ma_version_tag field of dictionary.
0025      * It is incremented each time that a dictionary is created and each
0026      * time that a dictionary is modified. */
0027     uint64_t global_version;
0028     uint32_t next_keys_version;
0029 
0030 #if PyDict_MAXFREELIST > 0
0031     /* Dictionary reuse scheme to save calls to malloc and free */
0032     PyDictObject *free_list[PyDict_MAXFREELIST];
0033     PyDictKeysObject *keys_free_list[PyDict_MAXFREELIST];
0034     int numfree;
0035     int keys_numfree;
0036 #endif
0037 
0038     PyDict_WatchCallback watchers[DICT_MAX_WATCHERS];
0039 };
0040 
0041 #define _dict_state_INIT \
0042     { \
0043         .next_keys_version = 2, \
0044     }
0045 
0046 
0047 #ifdef __cplusplus
0048 }
0049 #endif
0050 #endif   /* !Py_INTERNAL_DICT_STATE_H */