Returns the errno-style error code of the allocation. */
| 2672 | |
| 2673 | /* Returns the errno-style error code of the allocation. */ |
| 2674 | JEMALLOC_ALWAYS_INLINE int |
| 2675 | imalloc(static_opts_t *sopts, dynamic_opts_t *dopts) { |
| 2676 | if (tsd_get_allocates() && !imalloc_init_check(sopts, dopts)) { |
| 2677 | return ENOMEM; |
| 2678 | } |
| 2679 | |
| 2680 | /* We always need the tsd. Let's grab it right away. */ |
| 2681 | tsd_t *tsd = tsd_fetch(); |
| 2682 | assert(tsd); |
| 2683 | if (likely(tsd_fast(tsd))) { |
| 2684 | /* Fast and common path. */ |
| 2685 | tsd_assert_fast(tsd); |
| 2686 | sopts->slow = false; |
| 2687 | return imalloc_body(sopts, dopts, tsd); |
| 2688 | } else { |
| 2689 | if (!tsd_get_allocates() && !imalloc_init_check(sopts, dopts)) { |
| 2690 | return ENOMEM; |
| 2691 | } |
| 2692 | |
| 2693 | sopts->slow = true; |
| 2694 | return imalloc_body(sopts, dopts, tsd); |
| 2695 | } |
| 2696 | } |
| 2697 | |
| 2698 | JEMALLOC_NOINLINE |
| 2699 | void * |
no test coverage detected