| 541 | } |
| 542 | |
| 543 | static bool |
| 544 | tcaches_create_prep(tsd_t *tsd) { |
| 545 | bool err; |
| 546 | |
| 547 | malloc_mutex_lock(tsd_tsdn(tsd), &tcaches_mtx); |
| 548 | |
| 549 | if (tcaches == NULL) { |
| 550 | tcaches = base_alloc(tsd_tsdn(tsd), b0get(), sizeof(tcache_t *) |
| 551 | * (MALLOCX_TCACHE_MAX+1), CACHELINE); |
| 552 | if (tcaches == NULL) { |
| 553 | err = true; |
| 554 | goto label_return; |
| 555 | } |
| 556 | } |
| 557 | |
| 558 | if (tcaches_avail == NULL && tcaches_past > MALLOCX_TCACHE_MAX) { |
| 559 | err = true; |
| 560 | goto label_return; |
| 561 | } |
| 562 | |
| 563 | err = false; |
| 564 | label_return: |
| 565 | malloc_mutex_unlock(tsd_tsdn(tsd), &tcaches_mtx); |
| 566 | return err; |
| 567 | } |
| 568 | |
| 569 | bool |
| 570 | tcaches_create(tsd_t *tsd, unsigned *r_ind) { |
no test coverage detected