1#ifndef JEMALLOC_INTERNAL_ACTIVITY_CALLBACK_H
2#define JEMALLOC_INTERNAL_ACTIVITY_CALLBACK_H
3
4/*
5 * The callback to be executed "periodically", in response to some amount of
6 * allocator activity.
7 *
8 * This callback need not be computing any sort of peak (although that's the
9 * intended first use case), but we drive it from the peak counter, so it's
10 * keeps things tidy to keep it here.
11 *
12 * The calls to this thunk get driven by the peak_event module.
13 */
14#define ACTIVITY_CALLBACK_THUNK_INITIALIZER {NULL, NULL}
15typedef void (*activity_callback_t)(void *uctx, uint64_t allocated,
16 uint64_t deallocated);
17typedef struct activity_callback_thunk_s activity_callback_thunk_t;
18struct activity_callback_thunk_s {
19 activity_callback_t callback;
20 void *uctx;
21};
22
23#endif /* JEMALLOC_INTERNAL_ACTIVITY_CALLBACK_H */
24