* ind parameter is optional and is only checked and filled if alignment == 0; * return true if result is out of range. */
| 2292 | * return true if result is out of range. |
| 2293 | */ |
| 2294 | JEMALLOC_ALWAYS_INLINE bool |
| 2295 | aligned_usize_get(size_t size, size_t alignment, size_t *usize, szind_t *ind, |
| 2296 | bool bump_empty_aligned_alloc) { |
| 2297 | assert(usize != NULL); |
| 2298 | if (alignment == 0) { |
| 2299 | if (ind != NULL) { |
| 2300 | *ind = sz_size2index(size); |
| 2301 | if (unlikely(*ind >= SC_NSIZES)) { |
| 2302 | return true; |
| 2303 | } |
| 2304 | *usize = sz_index2size(*ind); |
| 2305 | assert(*usize > 0 && *usize <= SC_LARGE_MAXCLASS); |
| 2306 | return false; |
| 2307 | } |
| 2308 | *usize = sz_s2u(size); |
| 2309 | } else { |
| 2310 | if (bump_empty_aligned_alloc && unlikely(size == 0)) { |
| 2311 | size = 1; |
| 2312 | } |
| 2313 | *usize = sz_sa2u(size, alignment); |
| 2314 | } |
| 2315 | if (unlikely(*usize == 0 || *usize > SC_LARGE_MAXCLASS)) { |
| 2316 | return true; |
| 2317 | } |
| 2318 | return false; |
| 2319 | } |
| 2320 | |
| 2321 | JEMALLOC_ALWAYS_INLINE bool |
| 2322 | zero_get(bool guarantee, bool slow) { |
no test coverage detected