MCPcopy Create free account
hub / github.com/beefytech/Beef / prof_double_uint64_cast

Function prof_double_uint64_cast

BeefRT/JEMalloc/src/prof_data.c:526–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524 */
525#ifdef JEMALLOC_PROF
526static uint64_t
527prof_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
541void prof_unbias_map_init() {

Callers 1

prof_do_unbiasFunction · 0.85

Calls 1

roundFunction · 0.85

Tested by

no test coverage detected