| 441 | } |
| 442 | |
| 443 | void 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 | |
| 460 | int DeallocBlock(void* buf) { |
| 461 | if (!buf) { |
no test coverage detected