Called in UT.
| 270 | |
| 271 | // Called in UT. |
| 272 | void 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. |