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

Function RecycleAll

src/brpc/rdma/block_pool.cpp:443–458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

441}
442
443void RecycleAll() {
444 // Only block_type == 0 needs recycle
445 while (tls_idle_list) {
446 IdleNode* node = tls_idle_list;
447 tls_idle_list = node->next;
448 Region* r = GetRegion(node->start);
449 if (!r) {
450 continue;
451 }
452 uint64_t index = ((uintptr_t)node->start - r->start) * g_buckets / r->size;
453 BAIDU_SCOPED_LOCK(*g_info->lock[0][index]);
454 node->next = g_info->idle_list[0][index];
455 g_info->idle_list[0][index] = node;
456 }
457 tls_idle_num = 0;
458}
459
460int DeallocBlock(void* buf) {
461 if (!buf) {

Callers 1

DestroyBlockPoolFunction · 0.85

Calls 1

GetRegionFunction · 0.85

Tested by

no test coverage detected