Home
last modified time | relevance | path

Searched full:cache (Results 1 – 25 of 23035) sorted by relevance

12345678910>>...922

/aosp_15_r20/external/libnl/lib/
H A Dcache.c8 * @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>
57 #include "nl-priv-dynamic-core/cache-api.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 …]
/aosp_15_r20/external/python/cachetools/tests/
D__init__.py7 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 …]
Dtest_ttl.py29 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 …]
/aosp_15_r20/external/cronet/net/http/
H A Dhttp_cache_unittest.cc153 explicit DeleteCacheCompletionCallback(std::unique_ptr<MockHttpCache> cache) in DeleteCacheCompletionCallback() argument
154 : cache_(std::move(cache)) {} in DeleteCacheCompletionCallback()
198 void RunTransactionTestBase(HttpCache* cache, in RunTransactionTestBase() argument
209 // write to the cache in RunTransactionTestBase()
212 int rv = cache->CreateTransaction(DEFAULT_PRIORITY, &trans); in RunTransactionTestBase()
255 void RunTransactionTestWithRequest(HttpCache* cache, in RunTransactionTestWithRequest() argument
259 RunTransactionTestBase(cache, trans_info, request, response_info, in RunTransactionTestWithRequest()
264 void RunTransactionTestAndGetTiming(HttpCache* cache, in RunTransactionTestAndGetTiming() argument
268 RunTransactionTestBase(cache, trans_info, MockHttpRequest(trans_info), in RunTransactionTestAndGetTiming()
274 HttpCache* cache, in RunTransactionTestAndGetTimingAndConnectedSocketAddress() argument
[all …]
/aosp_15_r20/packages/modules/Bluetooth/system/gd/common/
Dlru_cache_test.cc29 LruCache<int, int> cache(3); // capacity = 3; in TEST() local
30 EXPECT_EQ(cache.size(), 0ul); in TEST()
31 EXPECT_EQ(cache.find(42), cache.end()); in TEST()
32 cache.clear(); // should not crash in TEST()
33 EXPECT_EQ(cache.find(42), cache.end()); in TEST()
34 EXPECT_FALSE(cache.contains(42)); in TEST()
35 EXPECT_FALSE(cache.extract(42)); in TEST()
46 // Cache with different order should not be equal in TEST()
51 // Cache with different value should be different in TEST()
54 // Cache with different capacity should not be equal in TEST()
[all …]
/aosp_15_r20/external/guava/guava-tests/test/com/google/common/cache/
H A DCacheBuilderGwtTest.java17 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 …]
/aosp_15_r20/external/guava/android/guava-tests/test/com/google/common/cache/
H A DCacheBuilderGwtTest.java17 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 …]
/aosp_15_r20/frameworks/base/core/tests/coretests/src/android/util/
H A DLruCacheTest.java44 LruCache<String, String> cache = new LruCache<String, String>(3); in testStatistics() local
45 assertStatistics(cache); in testStatistics()
47 assertEquals(null, cache.put("a", "A")); in testStatistics()
49 assertStatistics(cache); in testStatistics()
50 assertHit(cache, "a", "A"); in testStatistics()
51 assertSnapshot(cache, "a", "A"); in testStatistics()
53 assertEquals(null, cache.put("b", "B")); in testStatistics()
55 assertStatistics(cache); in testStatistics()
56 assertHit(cache, "a", "A"); in testStatistics()
57 assertHit(cache, "b", "B"); in testStatistics()
[all …]
/aosp_15_r20/external/cronet/net/ssl/
H A Dssl_client_session_cache_unittest.cc80 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 …]
/aosp_15_r20/cts/tests/tests/util/src/android/util/cts/
H A DLruCacheTest.java49 LruCache<String, String> cache = new LruCache<String, String>(3); in testStatistics() local
50 assertStatistics(cache); in testStatistics()
52 assertEquals(null, cache.put("a", "A")); in testStatistics()
54 assertStatistics(cache); in testStatistics()
55 assertHit(cache, "a", "A"); in testStatistics()
56 assertSnapshot(cache, "a", "A"); in testStatistics()
58 assertEquals(null, cache.put("b", "B")); in testStatistics()
60 assertStatistics(cache); in testStatistics()
61 assertHit(cache, "a", "A"); in testStatistics()
62 assertHit(cache, "b", "B"); in testStatistics()
[all …]
/aosp_15_r20/external/XNNPACK/src/
H A Dcache.c6 #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 …]
/aosp_15_r20/external/XNNPACK/test/
H A Dweights-cache.cc6 #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 …]
/aosp_15_r20/external/mesa3d/src/broadcom/vulkan/
H A Dv3dv_pipeline_cache.c55 cache_dump_stats(struct v3dv_pipeline_cache *cache) in cache_dump_stats() argument
57 fprintf(stderr, " NIR cache entries: %d\n", cache->nir_stats.count); in cache_dump_stats()
58 fprintf(stderr, " NIR cache miss count: %d\n", cache->nir_stats.miss); in cache_dump_stats()
59 fprintf(stderr, " NIR cache hit count: %d\n", cache->nir_stats.hit); in cache_dump_stats()
61 fprintf(stderr, " cache entries: %d\n", cache->stats.count); in cache_dump_stats()
62 fprintf(stderr, " cache miss count: %d\n", cache->stats.miss); in cache_dump_stats()
63 fprintf(stderr, " cache hit count: %d\n", cache->stats.hit); in cache_dump_stats()
65 fprintf(stderr, " on-disk cache hit count: %d\n", cache->stats.on_disk_hit); in cache_dump_stats()
69 pipeline_cache_lock(struct v3dv_pipeline_cache *cache) in pipeline_cache_lock() argument
71 if (!cache->externally_synchronized) in pipeline_cache_lock()
[all …]
/aosp_15_r20/external/squashfs-tools/squashfs-tools/
H A Dcaches-queues-lists.c148 /* 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 …]
/aosp_15_r20/external/rust/android-crates-io/crates/lru-cache/src/
Dlib.rs11 //! 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 …]
/aosp_15_r20/external/cronet/net/base/
H A Dexpiring_cache_unittest.cc25 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 …]
/aosp_15_r20/external/mesa3d/src/util/
H A Ddisk_cache.c53 /* The cache version should be bumped whenever a change is made to the
54 * structure of cache entries or the index. This will give any 3rd party
55 * applications reading the cache entries a chance to adjust to the changes.
57 * - The cache version is checked internally when reading a cache entry. If we
58 * ever have a mismatch we are in big trouble as this means we had a cache
62 * - There is no strict requirement that cache versions be backwards
74 disk_cache_init_queue(struct disk_cache *cache) in disk_cache_init_queue() argument
76 if (util_queue_is_initialized(&cache->cache_queue)) in disk_cache_init_queue()
82 * avoiding excessive memory use due to a backlog of cache entrys building in disk_cache_init_queue()
89 return util_queue_init(&cache->cache_queue, "disk$", 32, 4, in disk_cache_init_queue()
[all …]
/aosp_15_r20/external/libchrome/base/containers/
H A Dmru_cache_unittest.cc43 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 …]
/aosp_15_r20/external/rust/android-crates-io/crates/hashlink/tests/
Dlru_cache.rs5 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 …]
/aosp_15_r20/frameworks/native/cmds/installd/tests/
H A Dinstalld_cache_test.cpp145 mkdir("com.example/cache"); in TEST_F()
146 mkdir("com.example/cache/foo"); in TEST_F()
147 touch("com.example/cache/foo/one", 1 * kMbInBytes, 60); in TEST_F()
148 touch("com.example/cache/foo/two", 2 * kMbInBytes, 120); in TEST_F()
151 EXPECT_EQ(0, exists("com.example/cache/foo/one")); in TEST_F()
152 EXPECT_EQ(0, exists("com.example/cache/foo/two")); in TEST_F()
158 EXPECT_EQ(-1, exists("com.example/cache/foo/one")); in TEST_F()
159 EXPECT_EQ(-1, exists("com.example/cache/foo/two")); in TEST_F()
167 mkdir("com.example/cache"); in TEST_F()
168 mkdir("com.example/cache/foo"); in TEST_F()
[all …]
/aosp_15_r20/system/core/libutils/
H A DLruCache_test.cpp157 LruCache<SimpleKey, StringValue> cache(100); in TEST_F() local
159 EXPECT_EQ(nullptr, cache.get(0)); in TEST_F()
160 EXPECT_EQ(0u, cache.size()); in TEST_F()
164 LruCache<SimpleKey, StringValue> cache(100); in TEST_F() local
166 cache.put(1, "one"); in TEST_F()
167 cache.put(2, "two"); in TEST_F()
168 cache.put(3, "three"); in TEST_F()
169 EXPECT_STREQ("one", cache.get(1)); in TEST_F()
170 EXPECT_STREQ("two", cache.get(2)); in TEST_F()
171 EXPECT_STREQ("three", cache.get(3)); in TEST_F()
[all …]
/aosp_15_r20/external/cronet/base/containers/
H A Dlru_cache_unittest.cc84 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 …]
/aosp_15_r20/frameworks/base/core/tests/coretests/src/android/app/
H A DPropertyInvalidatedCacheTests.java143 // Create a cache that uses simple arithmetic to computer its values. in testBasicCache()
163 // Invalidate the cache, and verify that the next read on 3 goes to the server. in testBasicCache()
168 // Test bypass. The query for 13 always bypasses the cache. in testBasicCache()
269 // Create a cache from the args. The name of the cache is the api.
282 TestCache cache = new TestCache(); in testCacheRecompute() local
283 cache.invalidateCache(); in testCacheRecompute()
284 assertEquals(cache.isDisabled(), false); in testCacheRecompute()
285 assertEquals("foo5", cache.query(5)); in testCacheRecompute()
286 assertEquals(1, cache.getRecomputeCount()); in testCacheRecompute()
287 assertEquals("foo5", cache.query(5)); in testCacheRecompute()
[all …]
/aosp_15_r20/packages/modules/Bluetooth/system/common/
Dlru_unittest.cc33 LegacyLruCache<int, int> cache(3, "testing"); // capacity = 3; in TEST() local
34 cache.Put(1, 10); in TEST()
35 EXPECT_EQ(cache.Size(), 1); in TEST()
36 EXPECT_FALSE(cache.Put(2, 20)); in TEST()
37 EXPECT_FALSE(cache.Put(3, 30)); in TEST()
38 EXPECT_EQ(cache.Size(), 3); in TEST()
40 // 1, 2, 3 should be in cache in TEST()
41 EXPECT_TRUE(cache.Get(1, value)); in TEST()
43 EXPECT_TRUE(cache.Get(2, value)); in TEST()
45 EXPECT_TRUE(cache.Get(3, value)); in TEST()
[all …]
/aosp_15_r20/external/cpuinfo/test/
H A Dinit.cc119 const cpuinfo_cache* l1i = processor->cache.l1i; in TEST()
133 const cpuinfo_cache* l1d = processor->cache.l1d; in TEST()
147 const cpuinfo_cache* l2 = processor->cache.l2; in TEST()
161 const cpuinfo_cache* l3 = processor->cache.l3; in TEST()
175 const cpuinfo_cache* l4 = processor->cache.l4; in TEST()
771 const cpuinfo_cache* cache = cpuinfo_get_l1i_cache(i); in TEST() local
772 ASSERT_TRUE(cache); in TEST()
774 EXPECT_NE(0, cache->size); in TEST()
782 const cpuinfo_cache* cache = cpuinfo_get_l1i_cache(i); in TEST() local
783 ASSERT_TRUE(cache); in TEST()
[all …]

12345678910>>...922