Lines Matching defs:cache

106 // Each thread has its own cache of context state to avoid locking overhead
119 // Maximum number of strings to cache per thread.
130 // Maximum number of external thread references to cache per thread.
144 ContextCache* cache = tls_cache.get();
145 if (likely(cache)) {
146 if (likely(cache->generation == generation))
147 return cache;
148 if (unlikely(cache->generation > generation))
151 cache = new ContextCache();
152 tls_cache.reset(cache);
154 cache->generation = generation;
155 cache->thread_ref = trace_make_unknown_thread_ref();
156 cache->string_table.clear();
157 cache->thread_table.clear();
158 return cache;
163 ContextCache* cache = GetCurrentContextCache(generation);
164 if (unlikely(!cache))
167 auto it = cache->string_table.find(string_literal);
171 size_t count = cache->string_table.size();
175 StringEntry* entry = &cache->string_entries[count];
179 cache->string_table.insert(entry);
184 ContextCache* cache = GetCurrentContextCache(generation);
185 if (unlikely(!cache))
188 auto it = cache->thread_table.find(thread_koid);
192 size_t count = cache->thread_table.size();
196 ThreadEntry* entry = &cache->thread_entries[count];
199 cache->thread_table.insert(entry);
504 // Fast path: using the thread-local cache.
545 // TODO(ZX-1035): Since we can't use the thread-local cache here, cache
605 trace::ContextCache* cache = trace::GetCurrentContextCache(context->generation());
606 if (likely(cache && !trace_is_unknown_thread_ref(&cache->thread_ref))) {
608 *out_ref = cache->thread_ref;
620 if (likely(cache)) {
629 cache->thread_ref = trace_make_indexed_thread_ref(index);
631 cache->thread_ref = trace_make_inline_thread_ref(
634 *out_ref = cache->thread_ref;
639 // cache anything related to the current thread.
650 // TODO(ZX-1035): Since we can't use the thread-local cache here, cache