• Home
  • Raw
  • Download

Lines Matching full:dk

211 #define INCREF_KEYS(dk)  _Py_atomic_add_ssize(&dk->dk_refcnt, 1)  argument
213 #define DECREF_KEYS(dk) _Py_atomic_add_ssize(&dk->dk_refcnt, -1) argument
216 #define INCREF_KEYS_FT(dk) dictkeys_incref(dk) argument
217 #define DECREF_KEYS_FT(dk, shared) dictkeys_decref(_PyInterpreterState_GET(), dk, shared) argument
239 #define INCREF_KEYS(dk) dk->dk_refcnt++ argument
240 #define DECREF_KEYS(dk) dk->dk_refcnt-- argument
242 #define INCREF_KEYS_FT(dk) argument
243 #define DECREF_KEYS_FT(dk, shared) argument
457 #define DK_MASK(dk) (DK_SIZE(dk)-1) argument
469 dictkeys_incref(PyDictKeysObject *dk) in dictkeys_incref() argument
471 if (FT_ATOMIC_LOAD_SSIZE_RELAXED(dk->dk_refcnt) == _Py_IMMORTAL_REFCNT) { in dictkeys_incref()
477 INCREF_KEYS(dk); in dictkeys_incref()
481 dictkeys_decref(PyInterpreterState *interp, PyDictKeysObject *dk, bool use_qsbr) in dictkeys_decref() argument
483 if (FT_ATOMIC_LOAD_SSIZE_RELAXED(dk->dk_refcnt) == _Py_IMMORTAL_REFCNT) { in dictkeys_decref()
486 assert(FT_ATOMIC_LOAD_SSIZE(dk->dk_refcnt) > 0); in dictkeys_decref()
490 if (DECREF_KEYS(dk) == 1) { in dictkeys_decref()
491 if (DK_IS_UNICODE(dk)) { in dictkeys_decref()
492 PyDictUnicodeEntry *entries = DK_UNICODE_ENTRIES(dk); in dictkeys_decref()
494 for (i = 0, n = dk->dk_nentries; i < n; i++) { in dictkeys_decref()
500 PyDictKeyEntry *entries = DK_ENTRIES(dk); in dictkeys_decref()
502 for (i = 0, n = dk->dk_nentries; i < n; i++) { in dictkeys_decref()
507 free_keys_object(dk, use_qsbr); in dictkeys_decref()
665 dump_entries(PyDictKeysObject *dk) in dump_entries() argument
667 for (Py_ssize_t i = 0; i < dk->dk_nentries; i++) { in dump_entries()
668 if (DK_IS_UNICODE(dk)) { in dump_entries()
669 PyDictUnicodeEntry *ep = &DK_UNICODE_ENTRIES(dk)[i]; in dump_entries()
673 PyDictKeyEntry *ep = &DK_ENTRIES(dk)[i]; in dump_entries()
788 PyDictKeysObject *dk; in new_keys_object() local
814 dk = freelist->items[--freelist->numfree]; in new_keys_object()
820 dk = PyMem_Malloc(sizeof(PyDictKeysObject) in new_keys_object()
823 if (dk == NULL) { in new_keys_object()
831 dk->dk_refcnt = 1; in new_keys_object()
832 dk->dk_log2_size = log2_size; in new_keys_object()
833 dk->dk_log2_index_bytes = log2_bytes; in new_keys_object()
834 dk->dk_kind = unicode ? DICT_KEYS_UNICODE : DICT_KEYS_GENERAL; in new_keys_object()
836 dk->dk_mutex = (PyMutex){0}; in new_keys_object()
838 dk->dk_nentries = 0; in new_keys_object()
839 dk->dk_usable = usable; in new_keys_object()
840 dk->dk_version = 0; in new_keys_object()
841 memset(&dk->dk_indices[0], 0xff, ((size_t)1 << log2_bytes)); in new_keys_object()
842 memset(&dk->dk_indices[(size_t)1 << log2_bytes], 0, entry_size * usable); in new_keys_object()
843 return dk; in new_keys_object()
1052 do_lookup(PyDictObject *mp, PyDictKeysObject *dk, PyObject *key, Py_hash_t hash, in do_lookup() argument
1055 void *ep0 = _DK_ENTRIES(dk); in do_lookup()
1056 size_t mask = DK_MASK(dk); in do_lookup()
1061 ix = dictkeys_get_index(dk, i); in do_lookup()
1063 int cmp = check_lookup(mp, dk, ep0, ix, key, hash); in do_lookup()
1077 ix = dictkeys_get_index(dk, i); in do_lookup()
1079 int cmp = check_lookup(mp, dk, ep0, ix, key, hash); in do_lookup()
1096 compare_unicode_generic(PyDictObject *mp, PyDictKeysObject *dk, in compare_unicode_generic() argument
1112 if (dk == mp->ma_keys && ep->me_key == startkey) { in compare_unicode_generic()
1125 unicodekeys_lookup_generic(PyDictObject *mp, PyDictKeysObject* dk, PyObject *key, Py_hash_t hash) in unicodekeys_lookup_generic() argument
1127 return do_lookup(mp, dk, key, hash, compare_unicode_generic); in unicodekeys_lookup_generic()
1131 compare_unicode_unicode(PyDictObject *mp, PyDictKeysObject *dk, in compare_unicode_unicode() argument
1146 unicodekeys_lookup_unicode(PyDictKeysObject* dk, PyObject *key, Py_hash_t hash) in unicodekeys_lookup_unicode() argument
1148 return do_lookup(NULL, dk, key, hash, compare_unicode_unicode); in unicodekeys_lookup_unicode()
1152 compare_generic(PyDictObject *mp, PyDictKeysObject *dk, in compare_generic() argument
1168 if (dk == mp->ma_keys && ep->me_key == startkey) { in compare_generic()
1180 dictkeys_generic_lookup(PyDictObject *mp, PyDictKeysObject* dk, PyObject *key, Py_hash_t hash) in dictkeys_generic_lookup() argument
1182 return do_lookup(mp, dk, key, hash, compare_generic); in dictkeys_generic_lookup()
1192 _PyDictKeys_StringLookup(PyDictKeysObject* dk, PyObject *key) in _PyDictKeys_StringLookup() argument
1194 DictKeysKind kind = dk->dk_kind; in _PyDictKeys_StringLookup()
1206 return unicodekeys_lookup_unicode(dk, key, hash); in _PyDictKeys_StringLookup()
1212 unicodekeys_lookup_unicode_threadsafe(PyDictKeysObject* dk, PyObject *key,
1235 PyDictKeysObject *dk; in _Py_dict_lookup() local
1241 dk = mp->ma_keys; in _Py_dict_lookup()
1242 kind = dk->dk_kind; in _Py_dict_lookup()
1251 ix = unicodekeys_lookup_unicode_threadsafe(dk, key, hash); in _Py_dict_lookup()
1253 LOCK_KEYS(dk); in _Py_dict_lookup()
1254 ix = unicodekeys_lookup_unicode(dk, key, hash); in _Py_dict_lookup()
1255 UNLOCK_KEYS(dk); in _Py_dict_lookup()
1259 ix = unicodekeys_lookup_unicode(dk, key, hash); in _Py_dict_lookup()
1262 ix = unicodekeys_lookup_unicode(dk, key, hash); in _Py_dict_lookup()
1266 INCREF_KEYS_FT(dk); in _Py_dict_lookup()
1267 LOCK_KEYS_IF_SPLIT(dk, kind); in _Py_dict_lookup()
1269 ix = unicodekeys_lookup_generic(mp, dk, key, hash); in _Py_dict_lookup()
1271 UNLOCK_KEYS_IF_SPLIT(dk, kind); in _Py_dict_lookup()
1272 DECREF_KEYS_FT(dk, IS_DICT_SHARED(mp)); in _Py_dict_lookup()
1283 *value_addr = DK_UNICODE_ENTRIES(dk)[ix].me_value; in _Py_dict_lookup()
1291 ix = dictkeys_generic_lookup(mp, dk, key, hash); in _Py_dict_lookup()
1296 *value_addr = DK_ENTRIES(dk)[ix].me_value; in _Py_dict_lookup()
1347 compare_unicode_generic_threadsafe(PyDictObject *mp, PyDictKeysObject *dk, in compare_unicode_generic_threadsafe() argument
1366 if (dk == _Py_atomic_load_ptr_relaxed(&mp->ma_keys) && in compare_unicode_generic_threadsafe()
1384 unicodekeys_lookup_generic_threadsafe(PyDictObject *mp, PyDictKeysObject* dk, PyObject *key, Py_has… in unicodekeys_lookup_generic_threadsafe() argument
1386 return do_lookup(mp, dk, key, hash, compare_unicode_generic_threadsafe); in unicodekeys_lookup_generic_threadsafe()
1390 compare_unicode_unicode_threadsafe(PyDictObject *mp, PyDictKeysObject *dk, in compare_unicode_unicode_threadsafe() argument
1418 unicodekeys_lookup_unicode_threadsafe(PyDictKeysObject* dk, PyObject *key, Py_hash_t hash) in unicodekeys_lookup_unicode_threadsafe() argument
1420 return do_lookup(NULL, dk, key, hash, compare_unicode_unicode_threadsafe); in unicodekeys_lookup_unicode_threadsafe()
1424 compare_generic_threadsafe(PyDictObject *mp, PyDictKeysObject *dk, in compare_generic_threadsafe() argument
1442 if (dk == _Py_atomic_load_ptr_relaxed(&mp->ma_keys) && in compare_generic_threadsafe()
1455 dictkeys_generic_lookup_threadsafe(PyDictObject *mp, PyDictKeysObject* dk, PyObject *key, Py_hash_t… in dictkeys_generic_lookup_threadsafe() argument
1457 return do_lookup(mp, dk, key, hash, compare_generic_threadsafe); in dictkeys_generic_lookup_threadsafe()
1463 PyDictKeysObject *dk; in _Py_dict_lookup_threadsafe() local
1470 dk = _Py_atomic_load_ptr(&mp->ma_keys); in _Py_dict_lookup_threadsafe()
1471 kind = dk->dk_kind; in _Py_dict_lookup_threadsafe()
1475 ix = unicodekeys_lookup_unicode_threadsafe(dk, key, hash); in _Py_dict_lookup_threadsafe()
1478 ix = unicodekeys_lookup_generic_threadsafe(mp, dk, key, hash); in _Py_dict_lookup_threadsafe()
1504 value = _Py_TryXGetRef(&DK_UNICODE_ENTRIES(dk)[ix].me_value); in _Py_dict_lookup_threadsafe()
1509 if (dk != _Py_atomic_load_ptr(&mp->ma_keys)) { in _Py_dict_lookup_threadsafe()
1520 ix = dictkeys_generic_lookup_threadsafe(mp, dk, key, hash); in _Py_dict_lookup_threadsafe()
1525 value = _Py_TryXGetRef(&DK_ENTRIES(dk)[ix].me_value); in _Py_dict_lookup_threadsafe()
1529 if (dk != _Py_atomic_load_ptr(&mp->ma_keys)) { in _Py_dict_lookup_threadsafe()