aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2016-10-10 22:15:10 -0700
committerJason Evans <jasone@canonware.com>2016-10-10 22:31:37 -0700
commit45a5bf677299eb152c3c47836bd5d946234ce40e (patch)
treec4ca8aa8f0132e986e745d21f890a2420feb0ce2 /include
parent94e7ffa9794792d2ec70269a0ab9c282a32aa2ec (diff)
downloadjemalloc-45a5bf677299eb152c3c47836bd5d946234ce40e.tar.gz
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.
Diffstat (limited to 'include')
-rw-r--r--include/jemalloc/internal/nstime.h3
-rw-r--r--include/jemalloc/internal/private_symbols.txt1
2 files changed, 4 insertions, 0 deletions
diff --git a/include/jemalloc/internal/nstime.h b/include/jemalloc/internal/nstime.h
index c892bac..93b27dc 100644
--- a/include/jemalloc/internal/nstime.h
+++ b/include/jemalloc/internal/nstime.h
@@ -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
diff --git a/include/jemalloc/internal/private_symbols.txt b/include/jemalloc/internal/private_symbols.txt
index c59f82b..cd6681c 100644
--- a/include/jemalloc/internal/private_symbols.txt
+++ b/include/jemalloc/internal/private_symbols.txt
@@ -360,6 +360,7 @@ nstime_idivide
nstime_imultiply
nstime_init
nstime_init2
+nstime_monotonic
nstime_ns
nstime_nsec
nstime_sec