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

Method eraseImpl

flow/WriteOnlySet.actor.cpp:49–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48template <class T, class IndexType, IndexType CAPACITY>
49bool WriteOnlySet<T, IndexType, CAPACITY>::eraseImpl(Index idx) {
50 while (true) {
51 auto ptr = _set[idx].load();
52 if (ptr & LOCK) {
53 _set[idx].store(0);
54 freeList.push(reinterpret_cast<T*>(ptr ^ LOCK));
55 return false;
56 } else {
57 if (_set[idx].compare_exchange_strong(ptr, 0)) {
58 reinterpret_cast<T*>(ptr)->delref();
59 return true;
60 }
61 }
62 }
63}
64
65template <class T, class IndexType, IndexType CAPACITY>
66bool WriteOnlySet<T, IndexType, CAPACITY>::erase(Index idx) {

Callers

nothing calls this directly

Calls 4

loadMethod · 0.45
storeMethod · 0.45
pushMethod · 0.45
delrefMethod · 0.45

Tested by

no test coverage detected