| 1450 | #undef MALLOC_CONF_NSOURCES |
| 1451 | |
| 1452 | static bool |
| 1453 | malloc_init_hard_needed(void) { |
| 1454 | if (malloc_initialized() || (IS_INITIALIZER && malloc_init_state == |
| 1455 | malloc_init_recursible)) { |
| 1456 | /* |
| 1457 | * Another thread initialized the allocator before this one |
| 1458 | * acquired init_lock, or this thread is the initializing |
| 1459 | * thread, and it is recursively allocating. |
| 1460 | */ |
| 1461 | return false; |
| 1462 | } |
| 1463 | #ifdef JEMALLOC_THREADED_INIT |
| 1464 | if (malloc_initializer != NO_INITIALIZER && !IS_INITIALIZER) { |
| 1465 | /* Busy-wait until the initializing thread completes. */ |
| 1466 | spin_t spinner = SPIN_INITIALIZER; |
| 1467 | do { |
| 1468 | malloc_mutex_unlock(TSDN_NULL, &init_lock); |
| 1469 | spin_adaptive(&spinner); |
| 1470 | malloc_mutex_lock(TSDN_NULL, &init_lock); |
| 1471 | } while (!malloc_initialized()); |
| 1472 | return false; |
| 1473 | } |
| 1474 | #endif |
| 1475 | return true; |
| 1476 | } |
| 1477 | |
| 1478 | static bool |
| 1479 | malloc_init_hard_a0_locked() { |
no test coverage detected