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

Method get

src/bthread/fd.cpp:87–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85 }
86
87 butil::atomic<T>* get(size_t index) const {
88 const size_t block_index = index / BLOCK_SIZE;
89 if (__builtin_expect(block_index < NBLOCK, 1)) {
90 const size_t block_offset = index - block_index * BLOCK_SIZE;
91 Block* const b = _blocks[block_index].load(butil::memory_order_consume);
92 if (__builtin_expect(b != NULL, 1)) {
93 return b->items + block_offset;
94 }
95 }
96 return NULL;
97 }
98
99private:
100 butil::atomic<Block*> _blocks[NBLOCK];

Callers 6

borrow_keytableFunction · 0.45
return_keytableFunction · 0.45
fd_closeFunction · 0.45
runFunction · 0.45
SignalTraceMethod · 0.45

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected