| 524 | */ |
| 525 | #ifdef JEMALLOC_PROF |
| 526 | static uint64_t |
| 527 | prof_double_uint64_cast(double d) { |
| 528 | /* |
| 529 | * Note: UINT64_MAX + 1 is exactly representable as a double on all |
| 530 | * reasonable platforms (certainly those we'll support). Writing this |
| 531 | * as !(a < b) instead of (a >= b) means that we're NaN-safe. |
| 532 | */ |
| 533 | double rounded = round(d); |
| 534 | if (!(rounded < (double)UINT64_MAX)) { |
| 535 | return UINT64_MAX; |
| 536 | } |
| 537 | return (uint64_t)rounded; |
| 538 | } |
| 539 | #endif |
| 540 | |
| 541 | void prof_unbias_map_init() { |
no test coverage detected