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

Function remove_tls_block_chain

src/butil/iobuf.cpp:272–288  ·  view source on GitHub ↗

Called in UT.

Source from the content-addressed store, hash-verified

270
271// Called in UT.
272void remove_tls_block_chain() {
273 TLSData& tls_data = g_tls_data;
274 IOBuf::Block* b = tls_data.block_head;
275 if (!b) {
276 return;
277 }
278 tls_data.block_head = NULL;
279 int n = 0;
280 do {
281 IOBuf::Block* const saved_next = b->u.portal_next;
282 b->dec_ref();
283 b = saved_next;
284 ++n;
285 } while (b);
286 CHECK_EQ(n, tls_data.num_blocks);
287 tls_data.num_blocks = 0;
288}
289
290// Get a (non-full) block from TLS.
291// Notice that the block is not removed from TLS.

Callers 3

install_debug_allocatorFunction · 0.85
TEST_FFunction · 0.85

Calls 1

dec_refMethod · 0.45

Tested by 2

install_debug_allocatorFunction · 0.68
TEST_FFunction · 0.68