| /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 …]
|
| /external/libnl/lib/ |
| D | cache.c | 8 * @defgroup cache Cache 11 * Cache Management | | Type Specific Cache Operations 20 * 2) destroy old cache +----------- pp_cb ---------|---+ 42 * #include <netlink/cache.h> 49 #include <netlink/cache.h> 60 * Return the number of items in the cache 61 * @arg cache cache handle 63 int nl_cache_nitems(struct nl_cache *cache) in nl_cache_nitems() argument 65 return cache->c_nitems; in nl_cache_nitems() 69 * Return the number of items matching a filter in the cache [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/XNNPACK/src/ |
| D | cache.c | 6 #include "xnnpack/cache.h" 87 static inline size_t cache_size(struct xnn_cache* cache) { in cache_size() argument 88 switch (cache->type) { in cache_size() 90 return cache->code.size; in cache_size() 92 return cache->weights.size; in cache_size() 100 static inline void* cache_start(struct xnn_cache* cache) { in cache_start() argument 101 switch (cache->type) { in cache_start() 103 return cache->code.start; in cache_start() 105 return cache->weights.start; in cache_start() 112 enum xnn_status xnn_init_cache_with_size(struct xnn_cache* cache, size_t num_buckets, enum xnn_cach… in xnn_init_cache_with_size() argument [all …]
|
| /external/XNNPACK/test/ |
| D | weights-cache.cc | 6 #include <xnnpack/cache.h> 20 static void* cache_end(const xnn_weights_cache* cache) { in cache_end() argument 21 …n reinterpret_cast<void *>(reinterpret_cast<uintptr_t>(cache->cache.weights.start) + cache->cache.… in cache_end() 24 static void write_weights(xnn_weights_cache* cache, const std::string& str) { in write_weights() argument 25 ASSERT_NE(nullptr, xnn_reserve_space_in_weights_cache(cache, str.length())); in write_weights() 26 std::memcpy(cache_end(cache), str.data(), str.length()); in write_weights() 32 struct xnn_weights_cache cache; in TEST() local 33 EXPECT_EQ(xnn_status_success, xnn_init_weights_cache(&cache)); in TEST() 34 EXPECT_EQ(xnn_status_success, xnn_release_weights_cache(&cache)); in TEST() 41 struct xnn_weights_cache cache; in TEST() local [all …]
|
| D | code-cache.cc | 10 #include <xnnpack/cache.h> 14 static void* cache_end(const xnn_code_cache* cache) { in cache_end() argument 15 …urn reinterpret_cast<void *>(reinterpret_cast<uintptr_t>(cache->cache.code.start) + cache->cache.c… in cache_end() 18 static void write_code(xnn_code_cache* cache, const std::string& str) { in write_code() argument 19 ASSERT_GE(cache->cache.code.capacity - cache->cache.code.size, str.length()); in write_code() 20 std::memcpy(cache_end(cache), str.data(), str.length()); in write_code() 21 cache->cache.code.size += str.length(); in write_code() 27 xnn_code_cache cache; in TEST() local 28 EXPECT_EQ(xnn_status_success, xnn_init_code_cache(&cache)); in TEST() 29 EXPECT_EQ(xnn_status_success, xnn_release_code_cache(&cache)); in TEST() [all …]
|
| /external/cronet/net/ssl/ |
| D | ssl_client_session_cache_unittest.cc | 80 SSLClientSessionCache cache(config); in TEST_F() local 86 EXPECT_EQ(nullptr, cache.Lookup(MakeTestKey("key1")).get()); in TEST_F() 87 EXPECT_EQ(nullptr, cache.Lookup(MakeTestKey("key2")).get()); in TEST_F() 88 EXPECT_EQ(0u, cache.size()); in TEST_F() 90 cache.Insert(MakeTestKey("key1"), bssl::UpRef(session1)); in TEST_F() 91 EXPECT_EQ(session1.get(), cache.Lookup(MakeTestKey("key1")).get()); in TEST_F() 92 EXPECT_EQ(nullptr, cache.Lookup(MakeTestKey("key2")).get()); in TEST_F() 93 EXPECT_EQ(1u, cache.size()); in TEST_F() 95 cache.Insert(MakeTestKey("key2"), bssl::UpRef(session2)); in TEST_F() 96 EXPECT_EQ(session1.get(), cache.Lookup(MakeTestKey("key1")).get()); in TEST_F() [all …]
|
| /external/cronet/net/base/ |
| D | expiring_cache_unittest.cc | 25 Cache; typedef 39 Cache cache(kMaxCacheEntries); in TEST() local 43 EXPECT_EQ(0U, cache.size()); in TEST() 46 EXPECT_FALSE(cache.Get("entry1", now)); in TEST() 47 cache.Put("entry1", "test1", now, now + kTTL); in TEST() 48 EXPECT_THAT(cache.Get("entry1", now), Pointee(StrEq("test1"))); in TEST() 49 EXPECT_EQ(1U, cache.size()); in TEST() 55 EXPECT_FALSE(cache.Get("entry2", now)); in TEST() 56 cache.Put("entry2", "test2", now, now + kTTL); in TEST() 57 EXPECT_THAT(cache.Get("entry2", now), Pointee(StrEq("test2"))); in TEST() [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/cronet/net/http/ |
| D | http_cache_unittest.cc | 177 explicit DeleteCacheCompletionCallback(std::unique_ptr<MockHttpCache> cache) in DeleteCacheCompletionCallback() argument 178 : cache_(std::move(cache)) {} in DeleteCacheCompletionCallback() 222 void RunTransactionTestBase(HttpCache* cache, in RunTransactionTestBase() argument 233 // write to the cache in RunTransactionTestBase() 236 int rv = cache->CreateTransaction(DEFAULT_PRIORITY, &trans); in RunTransactionTestBase() 273 void RunTransactionTestWithRequest(HttpCache* cache, in RunTransactionTestWithRequest() argument 277 RunTransactionTestBase(cache, trans_info, request, response_info, in RunTransactionTestWithRequest() 282 void RunTransactionTestAndGetTiming(HttpCache* cache, in RunTransactionTestAndGetTiming() argument 286 RunTransactionTestBase(cache, trans_info, MockHttpRequest(trans_info), in RunTransactionTestAndGetTiming() 292 HttpCache* cache, in RunTransactionTestAndGetTimingAndConnectedSocketAddress() argument [all …]
|
| /external/cronet/base/containers/ |
| D | lru_cache_unittest.cc | 84 typedef typename TypeParam::template Type<int, CachedItem> Cache; in TYPED_TEST() typedef 85 Cache cache(Cache::NO_AUTO_EVICT); in TYPED_TEST() local 90 EXPECT_TRUE(cache.Get(0) == cache.end()); in TYPED_TEST() 91 EXPECT_TRUE(cache.Peek(0) == cache.end()); in TYPED_TEST() 96 auto inserted_item = cache.Put(kItem1Key, item1); in TYPED_TEST() 97 EXPECT_EQ(1U, cache.size()); in TYPED_TEST() 101 auto found = cache.Get(kItem1Key); in TYPED_TEST() 102 EXPECT_TRUE(inserted_item == cache.begin()); in TYPED_TEST() 103 EXPECT_TRUE(found != cache.end()); in TYPED_TEST() 105 found = cache.Peek(kItem1Key); in TYPED_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 …]
|