mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-20 09:21:14 +03:00
Do not advance decay epoch when time goes backwards.
Instead, move the epoch backward in time. Additionally, add nstime_monotonic() and use it in debug builds to assert that time only goes backward if nstime_update() is using a non-monotonic time source.
This commit is contained in:
parent
ee0c74b77a
commit
5f11fb7d43
6 changed files with 63 additions and 6 deletions
|
|
@ -31,9 +31,12 @@ void nstime_imultiply(nstime_t *time, uint64_t multiplier);
|
|||
void nstime_idivide(nstime_t *time, uint64_t divisor);
|
||||
uint64_t nstime_divide(const nstime_t *time, const nstime_t *divisor);
|
||||
#ifdef JEMALLOC_JET
|
||||
typedef bool (nstime_monotonic_t)(void);
|
||||
extern nstime_monotonic_t *nstime_monotonic;
|
||||
typedef bool (nstime_update_t)(nstime_t *);
|
||||
extern nstime_update_t *nstime_update;
|
||||
#else
|
||||
bool nstime_monotonic(void);
|
||||
bool nstime_update(nstime_t *time);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -298,6 +298,7 @@ nstime_idivide
|
|||
nstime_imultiply
|
||||
nstime_init
|
||||
nstime_init2
|
||||
nstime_monotonic
|
||||
nstime_ns
|
||||
nstime_nsec
|
||||
nstime_sec
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue