mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-26 10:37:19 +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
|
|
@ -176,6 +176,13 @@ TEST_BEGIN(test_nstime_divide)
|
|||
}
|
||||
TEST_END
|
||||
|
||||
TEST_BEGIN(test_nstime_monotonic)
|
||||
{
|
||||
|
||||
nstime_monotonic();
|
||||
}
|
||||
TEST_END
|
||||
|
||||
TEST_BEGIN(test_nstime_update)
|
||||
{
|
||||
nstime_t nst;
|
||||
|
|
@ -198,7 +205,6 @@ TEST_BEGIN(test_nstime_update)
|
|||
assert_d_eq(nstime_compare(&nst, &nst0), 0,
|
||||
"Time should not have been modified");
|
||||
}
|
||||
|
||||
}
|
||||
TEST_END
|
||||
|
||||
|
|
@ -216,5 +222,6 @@ main(void)
|
|||
test_nstime_imultiply,
|
||||
test_nstime_idivide,
|
||||
test_nstime_divide,
|
||||
test_nstime_monotonic,
|
||||
test_nstime_update));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue