MCPcopy Create free account
hub / github.com/apple/foundationdb / insert

Method insert

flow/WriteOnlySet.actor.cpp:33–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31#ifdef ENABLE_SAMPLING
32template <class T, class IndexType, IndexType CAPACITY>
33auto WriteOnlySet<T, IndexType, CAPACITY>::insert(const Reference<T>& lineage) -> Index {
34 Index res;
35 if (!freeQueue.pop(res)) {
36 TraceEvent(SevWarnAlways, "NoCapacityInWriteOnlySet");
37 return npos;
38 }
39 ASSERT(_set[res].load() == 0);
40 auto ptr = reinterpret_cast<uintptr_t>(lineage.getPtr());
41 ASSERT((ptr % 2) == 0); // this needs to be at least 2-byte aligned
42 ASSERT(ptr != 0);
43 lineage->addref();
44 _set[res].store(ptr);
45 return res;
46}
47
48template <class T, class IndexType, IndexType CAPACITY>
49bool WriteOnlySet<T, IndexType, CAPACITY>::eraseImpl(Index idx) {

Callers 15

verify_peerMethod · 0.45
parse_verifyMethod · 0.45
getAllUnsafeMethod · 0.45
getUniqueBlocksMethod · 0.45
flat_buffers.cppFile · 0.45
writerFunction · 0.45
getSupportedFiltersFunction · 0.45
getRandomFilterMethod · 0.45
RuleMethod · 0.45
verify_peerMethod · 0.45
registerHistogramMethod · 0.45

Calls 6

TraceEventClass · 0.85
popMethod · 0.45
loadMethod · 0.45
getPtrMethod · 0.45
addrefMethod · 0.45
storeMethod · 0.45

Tested by 4

pushMethod · 0.36
granule_start_loadFunction · 0.36
getRangeLoopMethod · 0.36