mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-13 16:36:21 +03:00
restrict bytes_until_sample to int64_t. This allows optimal asm
generation of sub bytes_until_sample, usize; je; for x86 arch. Subtraction is unconditional, and only flags are checked for the jump, no extra compare is necessary. This also reduces register pressure.
This commit is contained in:
parent
d1a861fa80
commit
997d86acc6
3 changed files with 13 additions and 6 deletions
|
|
@ -1168,6 +1168,9 @@ prof_sample_threshold_update(prof_tdata_t *tdata) {
|
|||
uint64_t bytes_until_sample = (uint64_t)(log(u) /
|
||||
log(1.0 - (1.0 / (double)((uint64_t)1U << lg_prof_sample))))
|
||||
+ (uint64_t)1U;
|
||||
if (bytes_until_sample > SSIZE_MAX) {
|
||||
bytes_until_sample = SSIZE_MAX;
|
||||
}
|
||||
tsd_bytes_until_sample_set(tsd_fetch(), bytes_until_sample);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue