MCPcopy Create free account
hub / github.com/apache/brpc / clear

Function clear

src/bthread/key.cpp:105–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103 }
104
105 void clear(uint32_t offset) {
106 for (uint32_t i = 0; i < KEY_2NDLEVEL_SIZE; ++i) {
107 void* p = _data[i].ptr;
108 if (p) {
109 // Set the position to NULL before calling dtor which may set
110 // the position again.
111 _data[i].ptr = NULL;
112
113 KeyInfo info = bthread::s_key_info[offset + i];
114 if (info.dtor && _data[i].version == info.version) {
115 info.dtor(p, info.dtor_args);
116 }
117 }
118 }
119 }
120
121 bool cleared() const {
122 // We need to iterate again to check if every slot is empty. An

Callers 2

initializeMethod · 0.50
~DHWrapperMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected