MCPcopy Create free account
hub / github.com/bytedance/bolt / initEntry

Method initEntry

bolt/common/caching/AsyncDataCache.cpp:248–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248CachePin CacheShard::initEntry(
249 RawFileCacheKey key,
250 AsyncDataCacheEntry* entry,
251 bool cacheable) {
252 // The new entry is in the map and is in exclusive mode and is otherwise
253 // uninitialized. Other threads may find it and may add a promise or wait for
254 // a promise that another one has added. The new entry is otherwise volatile
255 // and uninterpretable except for this thread. Non access serializing members
256 // can be set outside of 'mutex_'.
257 entry->initialize(
258 FileCacheKey{StringIdLease(fileIds(), key.fileNum), key.offset});
259 entry->setCacheable(cacheable);
260 cache_->incrementNew(entry->size());
261 CachePin pin;
262 pin.setEntry(entry);
263 return pin;
264}
265
266CoalescedLoad::~CoalescedLoad() {
267 // Continue possibly waiting threads.

Callers

nothing calls this directly

Calls 6

StringIdLeaseClass · 0.85
setCacheableMethod · 0.80
incrementNewMethod · 0.80
setEntryMethod · 0.80
initializeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected