mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-25 08:33:38 +03:00
Add background thread related stats.
This commit is contained in:
parent
b693c7868e
commit
2bee0c6251
9 changed files with 214 additions and 21 deletions
14
src/nstime.c
14
src/nstime.c
|
|
@ -55,6 +55,13 @@ nstime_add(nstime_t *time, const nstime_t *addend) {
|
|||
time->ns += addend->ns;
|
||||
}
|
||||
|
||||
void
|
||||
nstime_iadd(nstime_t *time, uint64_t addend) {
|
||||
assert(UINT64_MAX - time->ns >= addend);
|
||||
|
||||
time->ns += addend;
|
||||
}
|
||||
|
||||
void
|
||||
nstime_subtract(nstime_t *time, const nstime_t *subtrahend) {
|
||||
assert(nstime_compare(time, subtrahend) >= 0);
|
||||
|
|
@ -62,6 +69,13 @@ nstime_subtract(nstime_t *time, const nstime_t *subtrahend) {
|
|||
time->ns -= subtrahend->ns;
|
||||
}
|
||||
|
||||
void
|
||||
nstime_isubtract(nstime_t *time, uint64_t subtrahend) {
|
||||
assert(time->ns >= subtrahend);
|
||||
|
||||
time->ns -= subtrahend;
|
||||
}
|
||||
|
||||
void
|
||||
nstime_imultiply(nstime_t *time, uint64_t multiplier) {
|
||||
assert((((time->ns | multiplier) & (UINT64_MAX << (sizeof(uint64_t) <<
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue