Returns the errno-style error code of the allocation. */
| 2243 | |
| 2244 | /* Returns the errno-style error code of the allocation. */ |
| 2245 | JEMALLOC_ALWAYS_INLINE int |
| 2246 | imalloc(static_opts_t *sopts, dynamic_opts_t *dopts) { |
| 2247 | if (tsd_get_allocates() && !imalloc_init_check(sopts, dopts)) { |
| 2248 | return ENOMEM; |
| 2249 | } |
| 2250 | |
| 2251 | /* We always need the tsd. Let's grab it right away. */ |
| 2252 | tsd_t *tsd = tsd_fetch(); |
| 2253 | assert(tsd); |
| 2254 | if (likely(tsd_fast(tsd))) { |
| 2255 | /* Fast and common path. */ |
| 2256 | tsd_assert_fast(tsd); |
| 2257 | sopts->slow = false; |
| 2258 | return imalloc_body(sopts, dopts, tsd); |
| 2259 | } else { |
| 2260 | if (!tsd_get_allocates() && !imalloc_init_check(sopts, dopts)) { |
| 2261 | return ENOMEM; |
| 2262 | } |
| 2263 | |
| 2264 | sopts->slow = true; |
| 2265 | return imalloc_body(sopts, dopts, tsd); |
| 2266 | } |
| 2267 | } |
| 2268 | |
| 2269 | JEMALLOC_NOINLINE |
| 2270 | void * |
no test coverage detected