Lines Matching defs:cache
18 /* this object is used delimit args and keywords in the cache keys */
745 3). For a full cache, the pure python version rotates the location of the
748 version, links are temporarily removed while the cache dict updates are
798 PyObject *cache;
803 /* the kwd_mark is used delimit args and keywords in the cache keys */
905 result = _PyDict_GetItem_KnownHash(self->cache, key, hash);
922 if (_PyDict_SetItem_KnownHash(self->cache, key, result, hash) < 0) {
963 1) The initial check for a cache match. 2) The post user-function
964 check for a cache match. 3) The deletion of the oldest entry.
971 The __eq__ method call is always made for a cache hit (dict access #1).
972 Accordingly, we have make sure not modify the cache state prior to
981 either call it at the top of its code path before any cache
988 so that we know the cache is a consistent state.
1006 link = (lru_list_elem *)_PyDict_GetItem_KnownHash(self->cache, key, hash);
1026 testresult = _PyDict_GetItem_KnownHash(self->cache, key, hash);
1028 /* Getting here means that this same key was added to the cache
1045 proceed normally and update the cache with the new result. */
1048 if (PyDict_GET_SIZE(self->cache) < self->maxsize ||
1065 this same key, then this setitem call will update the cache dict
1067 having a cache dict entry that refers to it). */
1068 if (_PyDict_SetItem_KnownHash(self->cache, key, (PyObject *)link,
1077 /* Since the cache is full, we need to evict an old key and add
1080 to front of the cache to mark it as recently used.
1087 and the cache will no longer register as full.
1095 /* Remove it from the cache.
1096 The cache dict holds one reference to the link.
1099 popresult = _PyDict_Pop_KnownHash(self->cache, link->key,
1105 cache in an inconsistent state, we don't restore the link. */
1113 being evicted) from the cache. We restore the link to its
1132 /* Note: The link is being added to the cache dict without the
1134 for successful insertion in the cache dict before adding the
1137 if (_PyDict_SetItem_KnownHash(self->cache, key, (PyObject *)link,
1139 /* Somehow the cache dict update failed. We no longer can
1141 leave the cache short one link. */
1219 obj->cache = cachedict;
1261 Py_CLEAR(self->cache);
1308 PyDict_GET_SIZE(self->cache));
1312 PyDict_GET_SIZE(self->cache));
1320 PyDict_Clear(self->cache);
1357 Py_VISIT(self->cache);
1373 None for unlimited cache size\n\
1374 n for a bounded cache\n\
1376 typed: False cache f(3) and f(3.0) as identical calls\n\
1377 True cache f(3) and f(3.0) as distinct calls\n\