diff options
author | David Goldblatt <davidgoldblatt@fb.com> | 2017-04-19 20:39:33 (GMT) |
---|---|---|
committer | David Goldblatt <davidtgoldblatt@gmail.com> | 2017-04-24 17:33:21 (GMT) |
commit | bf2dc7e67840807fb90451ab34e7150401f7f7c4 (patch) | |
tree | 9c77417e674621c8136c31b93e09082b3a6ae960 /include/jemalloc | |
parent | fa3ad730c492c50f19fc68050ea5d5175b1df3cb (diff) | |
download | jemalloc-bf2dc7e67840807fb90451ab34e7150401f7f7c4.zip jemalloc-bf2dc7e67840807fb90451ab34e7150401f7f7c4.tar.gz jemalloc-bf2dc7e67840807fb90451ab34e7150401f7f7c4.tar.bz2 |
Header refactoring: ticker module - remove from the catchall and unify.
Diffstat (limited to 'include/jemalloc')
-rw-r--r-- | include/jemalloc/internal/arena_inlines_b.h | 1 | ||||
-rw-r--r-- | include/jemalloc/internal/arena_structs_b.h | 1 | ||||
-rw-r--r-- | include/jemalloc/internal/jemalloc_internal_includes.h | 3 | ||||
-rw-r--r-- | include/jemalloc/internal/jemalloc_internal_inlines_a.h | 1 | ||||
-rw-r--r-- | include/jemalloc/internal/tcache_inlines.h | 1 | ||||
-rw-r--r-- | include/jemalloc/internal/tcache_structs.h | 1 | ||||
-rw-r--r-- | include/jemalloc/internal/ticker.h (renamed from include/jemalloc/internal/ticker_inlines.h) | 19 | ||||
-rw-r--r-- | include/jemalloc/internal/ticker_structs.h | 9 | ||||
-rw-r--r-- | include/jemalloc/internal/ticker_types.h | 6 |
9 files changed, 21 insertions, 21 deletions
diff --git a/include/jemalloc/internal/arena_inlines_b.h b/include/jemalloc/internal/arena_inlines_b.h index 526103b..054757d 100644 --- a/include/jemalloc/internal/arena_inlines_b.h +++ b/include/jemalloc/internal/arena_inlines_b.h @@ -2,6 +2,7 @@ #define JEMALLOC_INTERNAL_ARENA_INLINES_B_H #include "jemalloc/internal/jemalloc_internal_types.h" +#include "jemalloc/internal/ticker.h" static inline szind_t arena_bin_index(arena_t *arena, arena_bin_t *bin) { diff --git a/include/jemalloc/internal/arena_structs_b.h b/include/jemalloc/internal/arena_structs_b.h index f2195f6..7b133f2 100644 --- a/include/jemalloc/internal/arena_structs_b.h +++ b/include/jemalloc/internal/arena_structs_b.h @@ -4,6 +4,7 @@ #include "jemalloc/internal/atomic.h" #include "jemalloc/internal/nstime.h" #include "jemalloc/internal/ql.h" +#include "jemalloc/internal/ticker.h" /* * Read-only information associated with each element of arena_t's bins array diff --git a/include/jemalloc/internal/jemalloc_internal_includes.h b/include/jemalloc/internal/jemalloc_internal_includes.h index 5e80f96..8ce7864 100644 --- a/include/jemalloc/internal/jemalloc_internal_includes.h +++ b/include/jemalloc/internal/jemalloc_internal_includes.h @@ -40,7 +40,6 @@ /* TYPES */ /******************************************************************************/ -#include "jemalloc/internal/ticker_types.h" #include "jemalloc/internal/ckh_types.h" #include "jemalloc/internal/size_classes.h" #include "jemalloc/internal/smoothstep.h" @@ -63,7 +62,6 @@ /* STRUCTS */ /******************************************************************************/ -#include "jemalloc/internal/ticker_structs.h" #include "jemalloc/internal/ckh_structs.h" #include "jemalloc/internal/witness_structs.h" #include "jemalloc/internal/mutex_structs.h" @@ -107,7 +105,6 @@ /* INLINES */ /******************************************************************************/ -#include "jemalloc/internal/ticker_inlines.h" #include "jemalloc/internal/tsd_inlines.h" #include "jemalloc/internal/witness_inlines.h" #include "jemalloc/internal/mutex_inlines.h" diff --git a/include/jemalloc/internal/jemalloc_internal_inlines_a.h b/include/jemalloc/internal/jemalloc_internal_inlines_a.h index 9cb933c..06a5c71 100644 --- a/include/jemalloc/internal/jemalloc_internal_inlines_a.h +++ b/include/jemalloc/internal/jemalloc_internal_inlines_a.h @@ -4,6 +4,7 @@ #include "jemalloc/internal/atomic.h" #include "jemalloc/internal/bit_util.h" #include "jemalloc/internal/jemalloc_internal_types.h" +#include "jemalloc/internal/ticker.h" JEMALLOC_ALWAYS_INLINE pszind_t psz2ind(size_t psz) { diff --git a/include/jemalloc/internal/tcache_inlines.h b/include/jemalloc/internal/tcache_inlines.h index 8b42af6..25931d8 100644 --- a/include/jemalloc/internal/tcache_inlines.h +++ b/include/jemalloc/internal/tcache_inlines.h @@ -2,6 +2,7 @@ #define JEMALLOC_INTERNAL_TCACHE_INLINES_H #include "jemalloc/internal/jemalloc_internal_types.h" +#include "jemalloc/internal/ticker.h" #include "jemalloc/internal/util.h" static inline bool diff --git a/include/jemalloc/internal/tcache_structs.h b/include/jemalloc/internal/tcache_structs.h index fe27f36..c01098f 100644 --- a/include/jemalloc/internal/tcache_structs.h +++ b/include/jemalloc/internal/tcache_structs.h @@ -2,6 +2,7 @@ #define JEMALLOC_INTERNAL_TCACHE_STRUCTS_H #include "jemalloc/internal/ql.h" +#include "jemalloc/internal/ticker.h" /* * Read-only information associated with each element of tcache_t's tbins array diff --git a/include/jemalloc/internal/ticker_inlines.h b/include/jemalloc/internal/ticker.h index cd5821f..faaac91 100644 --- a/include/jemalloc/internal/ticker_inlines.h +++ b/include/jemalloc/internal/ticker.h @@ -1,5 +1,18 @@ -#ifndef JEMALLOC_INTERNAL_TICKER_INLINES_H -#define JEMALLOC_INTERNAL_TICKER_INLINES_H +#ifndef JEMALLOC_INTERNAL_TICKER_H +#define JEMALLOC_INTERNAL_TICKER_H + +/** + * A ticker makes it easy to count-down events until some limit. You + * ticker_init the ticker to trigger every nticks events. You then notify it + * that an event has occurred with calls to ticker_tick (or that nticks events + * have occurred with a call to ticker_ticks), which will return true (and reset + * the counter) if the countdown hit zero. + */ + +typedef struct { + int32_t tick; + int32_t nticks; +} ticker_t; static inline void ticker_init(ticker_t *ticker, int32_t nticks) { @@ -32,4 +45,4 @@ ticker_tick(ticker_t *ticker) { return ticker_ticks(ticker, 1); } -#endif /* JEMALLOC_INTERNAL_TICKER_INLINES_H */ +#endif /* JEMALLOC_INTERNAL_TICKER_H */ diff --git a/include/jemalloc/internal/ticker_structs.h b/include/jemalloc/internal/ticker_structs.h deleted file mode 100644 index e30c4e2..0000000 --- a/include/jemalloc/internal/ticker_structs.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef JEMALLOC_INTERNAL_TICKER_STRUCTS_H -#define JEMALLOC_INTERNAL_TICKER_STRUCTS_H - -struct ticker_s { - int32_t tick; - int32_t nticks; -}; - -#endif /* JEMALLOC_INTERNAL_TICKER_STRUCTS_H */ diff --git a/include/jemalloc/internal/ticker_types.h b/include/jemalloc/internal/ticker_types.h deleted file mode 100644 index 62d67f3..0000000 --- a/include/jemalloc/internal/ticker_types.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef JEMALLOC_INTERNAL_TICKER_TYPES_H -#define JEMALLOC_INTERNAL_TICKER_TYPES_H - -typedef struct ticker_s ticker_t; - -#endif /* JEMALLOC_INTERNAL_TICKER_TYPES_H */ |