• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************/
2 #ifdef JEMALLOC_H_TYPES
3 
4 typedef struct nstime_s nstime_t;
5 
6 /* Maximum supported number of seconds (~584 years). */
7 #define	NSTIME_SEC_MAX	KQU(18446744072)
8 
9 #endif /* JEMALLOC_H_TYPES */
10 /******************************************************************************/
11 #ifdef JEMALLOC_H_STRUCTS
12 
13 struct nstime_s {
14 	uint64_t	ns;
15 };
16 
17 #endif /* JEMALLOC_H_STRUCTS */
18 /******************************************************************************/
19 #ifdef JEMALLOC_H_EXTERNS
20 
21 void	nstime_init(nstime_t *time, uint64_t ns);
22 void	nstime_init2(nstime_t *time, uint64_t sec, uint64_t nsec);
23 uint64_t	nstime_ns(const nstime_t *time);
24 uint64_t	nstime_sec(const nstime_t *time);
25 uint64_t	nstime_nsec(const nstime_t *time);
26 void	nstime_copy(nstime_t *time, const nstime_t *source);
27 int	nstime_compare(const nstime_t *a, const nstime_t *b);
28 void	nstime_add(nstime_t *time, const nstime_t *addend);
29 void	nstime_subtract(nstime_t *time, const nstime_t *subtrahend);
30 void	nstime_imultiply(nstime_t *time, uint64_t multiplier);
31 void	nstime_idivide(nstime_t *time, uint64_t divisor);
32 uint64_t	nstime_divide(const nstime_t *time, const nstime_t *divisor);
33 #ifdef JEMALLOC_JET
34 typedef bool (nstime_monotonic_t)(void);
35 extern nstime_monotonic_t *nstime_monotonic;
36 typedef bool (nstime_update_t)(nstime_t *);
37 extern nstime_update_t *nstime_update;
38 #else
39 bool	nstime_monotonic(void);
40 bool	nstime_update(nstime_t *time);
41 #endif
42 
43 #endif /* JEMALLOC_H_EXTERNS */
44 /******************************************************************************/
45 #ifdef JEMALLOC_H_INLINES
46 
47 #endif /* JEMALLOC_H_INLINES */
48 /******************************************************************************/
49