/external/python/cachetools/tests/ |
D | __init__.py | 7 Cache = None variable in CacheTestMixin 10 cache = self.Cache(maxsize=1) 11 self.assertEqual(0, len(cache)) 12 self.assertEqual(1, cache.maxsize) 13 self.assertEqual(0, cache.currsize) 14 self.assertEqual(1, cache.getsizeof(None)) 15 self.assertEqual(1, cache.getsizeof("")) 16 self.assertEqual(1, cache.getsizeof(0)) 17 self.assertTrue(repr(cache).startswith(cache.__class__.__name__)) 20 cache = self.Cache(maxsize=2) [all …]
|
D | test_ttl.py | 29 Cache = TTLTestCache variable in TTLCacheTest 32 cache = TTLCache(maxsize=2, ttl=1, timer=Timer()) 33 self.assertEqual(0, cache.timer()) 34 self.assertEqual(1, cache.ttl) 36 cache[1] = 1 37 self.assertEqual({1}, set(cache)) 38 self.assertEqual(1, len(cache)) 39 self.assertEqual(1, cache[1]) 41 cache.timer.tick() 42 self.assertEqual({1}, set(cache)) [all …]
|
D | test_wrapper.py | 8 def cache(self, minsize): member in DecoratorTestMixin 19 cache = self.cache(2) 20 wrapper = cachetools.cached(cache)(self.func) 22 self.assertEqual(len(cache), 0) 26 self.assertEqual(len(cache), 1) 27 self.assertIn(cachetools.keys.hashkey(0), cache) 28 self.assertNotIn(cachetools.keys.hashkey(1), cache) 29 self.assertNotIn(cachetools.keys.hashkey(1.0), cache) 32 self.assertEqual(len(cache), 2) 33 self.assertIn(cachetools.keys.hashkey(0), cache) [all …]
|
/external/libnl/lib/ |
D | cache.c | 3 * lib/cache.c Caching Module 15 * @defgroup cache Cache 18 * Cache Management | | Type Specific Cache Operations 27 * 2) destroy old cache +----------- pp_cb ---------|---+ 49 * #include <netlink/cache.h> 55 #include <netlink/cache.h> 66 * Return the number of items in the cache 67 * @arg cache cache handle 69 int nl_cache_nitems(struct nl_cache *cache) in nl_cache_nitems() argument 71 return cache->c_nitems; in nl_cache_nitems() [all …]
|
D | cache_mngt.c | 3 * lib/cache_mngt.c Cache Management 25 * #include <netlink/cache.h> 31 #include <netlink/cache.h> 38 * @name Cache Operations Sets 55 * @arg ops Cache operations 64 * @arg ops Cache operations 72 * Lookup cache operations by name 73 * @arg name name of the cache type 78 * @return The cache operations or NULL if not found. 92 * Lookup cache operations by name [all …]
|
/external/guava/guava-tests/test/com/google/common/cache/ |
D | CacheBuilderGwtTest.java | 17 package com.google.common.cache; 54 final Cache<Integer, Integer> cache = CacheBuilder.newBuilder().build(); in testLoader() local 66 cache.put(0, 10); in testLoader() 68 assertEquals(Integer.valueOf(10), cache.get(0, loader)); in testLoader() 69 assertEquals(Integer.valueOf(1), cache.get(20, loader)); in testLoader() 70 assertEquals(Integer.valueOf(2), cache.get(34, loader)); in testLoader() 72 cache.invalidate(0); in testLoader() 73 assertEquals(Integer.valueOf(3), cache.get(0, loader)); in testLoader() 75 cache.put(0, 10); in testLoader() 76 cache.invalidateAll(); in testLoader() [all …]
|
D | CacheEvictionTest.java | 15 package com.google.common.cache; 17 import static com.google.common.cache.TestingCacheLoaders.identityLoader; 18 import static com.google.common.cache.TestingRemovalListeners.countingRemovalListener; 19 import static com.google.common.cache.TestingWeighers.constantWeigher; 20 import static com.google.common.cache.TestingWeighers.intKeyWeigher; 21 import static com.google.common.cache.TestingWeighers.intValueWeigher; 25 import com.google.common.cache.CacheTesting.Receiver; 26 import com.google.common.cache.TestingCacheLoaders.IdentityLoader; 27 import com.google.common.cache.TestingRemovalListeners.CountingRemovalListener; 33 * Tests relating to cache eviction: what does and doesn't count toward maximumSize, what happens [all …]
|
/external/guava/android/guava-tests/test/com/google/common/cache/ |
D | CacheBuilderGwtTest.java | 17 package com.google.common.cache; 54 final Cache<Integer, Integer> cache = CacheBuilder.newBuilder().build(); in testLoader() local 66 cache.put(0, 10); in testLoader() 68 assertEquals(Integer.valueOf(10), cache.get(0, loader)); in testLoader() 69 assertEquals(Integer.valueOf(1), cache.get(20, loader)); in testLoader() 70 assertEquals(Integer.valueOf(2), cache.get(34, loader)); in testLoader() 72 cache.invalidate(0); in testLoader() 73 assertEquals(Integer.valueOf(3), cache.get(0, loader)); in testLoader() 75 cache.put(0, 10); in testLoader() 76 cache.invalidateAll(); in testLoader() [all …]
|
D | CacheEvictionTest.java | 15 package com.google.common.cache; 17 import static com.google.common.cache.TestingCacheLoaders.identityLoader; 18 import static com.google.common.cache.TestingRemovalListeners.countingRemovalListener; 19 import static com.google.common.cache.TestingWeighers.constantWeigher; 20 import static com.google.common.cache.TestingWeighers.intKeyWeigher; 21 import static com.google.common.cache.TestingWeighers.intValueWeigher; 25 import com.google.common.cache.CacheTesting.Receiver; 26 import com.google.common.cache.TestingCacheLoaders.IdentityLoader; 27 import com.google.common.cache.TestingRemovalListeners.CountingRemovalListener; 33 * Tests relating to cache eviction: what does and doesn't count toward maximumSize, what happens [all …]
|
/external/rust/crates/hashlink/tests/ |
D | lru_cache.rs | 5 let mut cache = LruCache::new(2); in test_put_and_get() localVariable 6 cache.insert(1, 10); in test_put_and_get() 7 cache.insert(2, 20); in test_put_and_get() 8 assert_eq!(cache.get_mut(&1), Some(&mut 10)); in test_put_and_get() 9 assert_eq!(cache.get_mut(&2), Some(&mut 20)); in test_put_and_get() 10 assert_eq!(cache.len(), 2); in test_put_and_get() 15 let mut cache = LruCache::new(1); in test_put_update() localVariable 16 cache.insert("1", 10); in test_put_update() 17 cache.insert("1", 19); in test_put_update() 18 assert_eq!(cache.get_mut("1"), Some(&mut 19)); in test_put_update() [all …]
|
/external/libchrome/base/containers/ |
D | mru_cache_unittest.cc | 43 typedef base::MRUCache<int, CachedItem> Cache; in TEST() typedef 44 Cache cache(Cache::NO_AUTO_EVICT); in TEST() local 49 EXPECT_TRUE(cache.Get(0) == cache.end()); in TEST() 50 EXPECT_TRUE(cache.Peek(0) == cache.end()); in TEST() 55 Cache::iterator inserted_item = cache.Put(kItem1Key, item1); in TEST() 56 EXPECT_EQ(1U, cache.size()); in TEST() 60 Cache::iterator found = cache.Get(kItem1Key); in TEST() 61 EXPECT_TRUE(inserted_item == cache.begin()); in TEST() 62 EXPECT_TRUE(found != cache.end()); in TEST() 64 found = cache.Peek(kItem1Key); in TEST() [all …]
|
/external/squashfs-tools/squashfs-tools/ |
D | caches-queues-lists.c | 148 /* Called with the cache mutex held */ 265 /* define cache hash tables */ 268 /* Called with the cache mutex held */ 269 INSERT_HASH_TABLE(cache, struct cache, CALCULATE_CACHE_HASH, index, hash) 271 /* Called with the cache mutex held */ 272 REMOVE_HASH_TABLE(cache, struct cache, CALCULATE_CACHE_HASH, index, hash); 274 /* define cache free list */ 276 /* Called with the cache mutex held */ 279 /* Called with the cache mutex held */ in INSERT_LIST() 283 struct cache *cache_init(int buffer_size, int max_buffers, int noshrink_lookup, in INSERT_LIST() [all …]
|
/external/mesa3d/src/gallium/auxiliary/util/ |
D | u_cache.c | 30 * Improved cache implementation. 76 /** Max entries in the cache */ 82 /** Number of entries in the cache */ 91 ensure_sanity(const struct util_cache *cache); 96 * Create a new cache with 'size' entries. Also provide functions for 105 struct util_cache *cache; in util_cache_create() local 107 cache = CALLOC_STRUCT(util_cache); in util_cache_create() 108 if (!cache) in util_cache_create() 111 cache->hash = hash; in util_cache_create() 112 cache->compare = compare; in util_cache_create() [all …]
|
/external/rust/crates/lru-cache/src/ |
D | lib.rs | 11 //! A cache that holds a limited number of key-value pairs. When the 12 //! capacity of the cache is exceeded, the least-recently-used 13 //! (where "used" means a look-up or putting the pair into the cache) 21 //! let mut cache = LruCache::new(2); 23 //! cache.insert(1, 10); 24 //! cache.insert(2, 20); 25 //! cache.insert(3, 30); 26 //! assert!(cache.get_mut(&1).is_none()); 27 //! assert_eq!(*cache.get_mut(&2).unwrap(), 20); 28 //! assert_eq!(*cache.get_mut(&3).unwrap(), 30); [all …]
|
/external/swiftshader/tests/SystemUnitTests/ |
D | LRUCacheTests.cpp | 26 template<typename Cache> 27 void checkRange(const Cache &cache, std::vector<std::pair<typename Cache::Key, typename Cache::Data… in checkRange() argument 30 for(auto it : cache) in checkRange() 46 LRUCache<std::string, std::string> cache(8); in TEST() local 47 ASSERT_EQ(cache.lookup(""), ""); in TEST() 48 ASSERT_EQ(cache.lookup("123"), ""); in TEST() 50 for(auto ignored : cache) in TEST() 57 FAIL() << "Should not loop on empty cache"; in TEST() 63 LRUCache<std::string, std::string> cache(4); in TEST() local 65 cache.add("1", "one"); in TEST() [all …]
|
/external/freetype/src/cache/ |
D | ftccache.c | 5 * The FreeType internal cache interface (body). 27 #define FT_COMPONENT cache 41 /***** CACHE NODE DEFINITIONS *****/ 86 /* get a top bucket for specified hash from cache, 87 * body for FTC_NODE_TOP_FOR_HASH( cache, hash ) 90 ftc_get_top_node_for_hash( FTC_Cache cache, in ftc_get_top_node_for_hash() argument 96 idx = hash & cache->mask; in ftc_get_top_node_for_hash() 97 if ( idx < cache->p ) in ftc_get_top_node_for_hash() 98 idx = hash & ( 2 * cache->mask + 1 ); in ftc_get_top_node_for_hash() 100 return cache->buckets + idx; in ftc_get_top_node_for_hash() [all …]
|
/external/mesa3d/src/amd/vulkan/ |
D | radv_pipeline_cache.c | 47 radv_pipeline_cache_lock(struct radv_pipeline_cache *cache) in radv_pipeline_cache_lock() argument 49 if (cache->flags & VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT) in radv_pipeline_cache_lock() 52 pthread_mutex_lock(&cache->mutex); in radv_pipeline_cache_lock() 56 radv_pipeline_cache_unlock(struct radv_pipeline_cache *cache) in radv_pipeline_cache_unlock() argument 58 if (cache->flags & VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT) in radv_pipeline_cache_unlock() 61 pthread_mutex_unlock(&cache->mutex); in radv_pipeline_cache_unlock() 65 radv_pipeline_cache_init(struct radv_pipeline_cache *cache, in radv_pipeline_cache_init() argument 68 cache->device = device; in radv_pipeline_cache_init() 69 pthread_mutex_init(&cache->mutex, NULL); in radv_pipeline_cache_init() 70 cache->flags = 0; in radv_pipeline_cache_init() [all …]
|
/external/squashfs-tools/kernel/fs/squashfs/ |
D | cache.c | 21 * cache.c 28 * This file implements a generic cache implementation used for both caches, 29 * plus functions layered ontop of the generic cache implementation to 32 * To avoid out of memory and fragmentation isssues with vmalloc the cache 35 * It should be noted that the cache is not used for file datablocks, these 36 * are decompressed and cached in the page-cache in the normal way. The 37 * cache is only used to temporarily cache fragment and metadata blocks 63 * Look-up block in cache, and increment usage count. If not in cache, read 67 struct squashfs_cache *cache, u64 block, int length) in squashfs_cache_get() argument 72 spin_lock(&cache->lock); in squashfs_cache_get() [all …]
|
/external/deqp-deps/amber/third_party/ |
D | CMakeLists.txt | 23 set(SPIRV-Headers_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/spirv-headers CACHE STRING "") 24 set(SPIRV_SKIP_TESTS ON CACHE BOOL ON) 29 set(ENABLE_HLSL ON CACHE BOOL ON) 30 set(BUILD_TESTING FALSE CACHE BOOL ON) 31 set(ENABLE_GLSLANG_BINARIES OFF CACHE BOOL ON) 32 set(ENABLE_SPVREMAPPER OFF CACHE BOOL ON) 34 set(LLVM_USE_CRT_DEBUG MTd CACHE STRING "") 35 set(LLVM_USE_CRT_RELEASE MT CACHE STRING "") 36 set(LLVM_USE_CRT_RELWITHDEBINFO MT CACHE STRING "") 39 set(SHADERC_THIRD_PARTY_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE STRING "") [all …]
|
/external/mesa3d/src/freedreno/vulkan/ |
D | tu_pipeline_cache.c | 48 tu_pipeline_cache_init(struct tu_pipeline_cache *cache, in tu_pipeline_cache_init() argument 51 cache->device = device; in tu_pipeline_cache_init() 52 pthread_mutex_init(&cache->mutex, NULL); in tu_pipeline_cache_init() 54 cache->modified = false; in tu_pipeline_cache_init() 55 cache->kernel_count = 0; in tu_pipeline_cache_init() 56 cache->total_size = 0; in tu_pipeline_cache_init() 57 cache->table_size = 1024; in tu_pipeline_cache_init() 58 const size_t byte_size = cache->table_size * sizeof(cache->hash_table[0]); in tu_pipeline_cache_init() 59 cache->hash_table = malloc(byte_size); in tu_pipeline_cache_init() 62 * cache. Disable caching when we want to keep shader debug info, since in tu_pipeline_cache_init() [all …]
|
/external/mesa3d/src/broadcom/vulkan/ |
D | v3dv_pipeline_cache.c | 54 cache_dump_stats(struct v3dv_pipeline_cache *cache) in cache_dump_stats() argument 59 fprintf(stderr, " NIR cache entries: %d\n", cache->nir_stats.count); in cache_dump_stats() 60 fprintf(stderr, " NIR cache miss count: %d\n", cache->nir_stats.miss); in cache_dump_stats() 61 fprintf(stderr, " NIR cache hit count: %d\n", cache->nir_stats.hit); in cache_dump_stats() 63 fprintf(stderr, " variant cache entries: %d\n", cache->variant_stats.count); in cache_dump_stats() 64 fprintf(stderr, " variant cache miss count: %d\n", cache->variant_stats.miss); in cache_dump_stats() 65 fprintf(stderr, " variant cache hit count: %d\n", cache->variant_stats.hit); in cache_dump_stats() 70 struct v3dv_pipeline_cache *cache, in v3dv_pipeline_cache_upload_nir() argument 74 if (!cache || !cache->nir_cache) in v3dv_pipeline_cache_upload_nir() 77 if (cache->nir_stats.count > V3DV_MAX_PIPELINE_CACHE_ENTRIES) in v3dv_pipeline_cache_upload_nir() [all …]
|
/external/volley/core/src/test/java/com/android/volley/toolbox/ |
D | DiskBasedCacheTest.java | 35 import com.android.volley.Cache; 67 private Cache cache; field in DiskBasedCacheTest 75 // Initialize empty cache in setup() 76 cache = new DiskBasedCache(temporaryFolder.getRoot(), MAX_SIZE); in setup() 77 cache.initialize(); in setup() 82 cache = null; in teardown() 87 assertThat(cache.get("key"), is(nullValue())); in testEmptyInitialize() 92 Cache.Entry entry = new Cache.Entry(); in testPutGetZeroBytes() 102 cache.put("my-magical-key", entry); in testPutGetZeroBytes() 104 assertThatEntriesAreEqual(cache.get("my-magical-key"), entry); in testPutGetZeroBytes() [all …]
|
/external/mesa3d/src/util/ |
D | disk_cache.c | 51 /* The cache version should be bumped whenever a change is made to the 52 * structure of cache entries or the index. This will give any 3rd party 53 * applications reading the cache entries a chance to adjust to the changes. 55 * - The cache version is checked internally when reading a cache entry. If we 56 * ever have a mismatch we are in big trouble as this means we had a cache 60 * - There is no strict requirement that cache versions be backwards 76 struct disk_cache *cache = NULL; in disk_cache_create() local 91 cache = rzalloc(NULL, struct disk_cache); in disk_cache_create() 92 if (cache == NULL) in disk_cache_create() 96 cache->path_init_failed = true; in disk_cache_create() [all …]
|
/external/icu/icu4c/source/test/intltest/ |
D | unifiedcachetest.cpp | 98 const UnifiedCache *cache = UnifiedCache::getInstance(status); in TestEvictionUnderStress() local 99 int64_t evictedCountBefore = cache->autoEvictedCount(); in TestEvictionUnderStress() 103 int64_t evictedCountAfter = cache->autoEvictedCount(); in TestEvictionUnderStress() 105 dataerrln("%s:%d Items should have been evicted from cache", in TestEvictionUnderStress() 116 // cache API incorrectly by creating their own cache instances. in TestEvictionPolicy() 121 // their own cache! in TestEvictionPolicy() 122 UnifiedCache cache(status); in TestEvictionPolicy() local 126 cache.setEvictionPolicy(0, 100, status); in TestEvictionPolicy() 137 cache.get( in TestEvictionPolicy() 139 &cache, in TestEvictionPolicy() [all …]
|
/external/mesa3d/src/mesa/drivers/dri/i965/ |
D | brw_program_cache.c | 34 * This file implements a simple program cache for 965. The consumers can 37 * data) in return. Objects in the cache may not have relocations 43 * Replacement is not implemented. Instead, when the cache gets too 44 * big we throw out all of the cache data and let it get regenerated. 119 search_cache(struct brw_cache *cache, GLuint hash, in search_cache() argument 127 for (c = cache->items[hash % cache->size]; c; c = c->next) in search_cache() 130 fprintf(stderr, "bucket %d/%d = %d/%d items\n", hash % cache->size, in search_cache() 131 cache->size, bucketcount, cache->n_items); in search_cache() 134 for (c = cache->items[hash % cache->size]; c; c = c->next) { in search_cache() 144 rehash(struct brw_cache *cache) in rehash() argument [all …]
|