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

Function DestroyBlockPool

src/brpc/rdma/block_pool.cpp:577–601  ·  view source on GitHub ↗

Just for UT

Source from the content-addressed store, hash-verified

575
576// Just for UT
577void DestroyBlockPool() {
578 RecycleAll();
579 for (int i = 0; i < BLOCK_SIZE_COUNT; ++i) {
580 for (size_t j = 0; j < g_buckets; ++j) {
581 IdleNode* node = g_info->idle_list[i][j];
582 while (node) {
583 IdleNode* tmp = node->next;
584 butil::return_object<IdleNode>(node);
585 node = tmp;
586 }
587 g_info->idle_list[i][j] = NULL;
588 }
589 }
590 delete g_info;
591 g_info = NULL;
592 for (int i = 0; i < g_region_num; ++i) {
593 if (g_regions[i].start == 0) {
594 break;
595 }
596 free((void*)g_regions[i].start);
597 g_regions[i].start = 0;
598 }
599 g_region_num = 0;
600 g_cb = NULL;
601}
602
603// Just for UT
604int GetBlockType(void* buf) {

Callers 1

TEST_FFunction · 0.85

Calls 1

RecycleAllFunction · 0.85

Tested by 1

TEST_FFunction · 0.68