2017-01-11 10:06:31 +08:00
|
|
|
#ifndef JEMALLOC_INTERNAL_ARENA_INLINES_A_H
|
|
|
|
#define JEMALLOC_INTERNAL_ARENA_INLINES_A_H
|
|
|
|
|
2017-04-22 00:37:34 +08:00
|
|
|
static inline unsigned
|
2017-01-16 08:56:30 +08:00
|
|
|
arena_ind_get(const arena_t *arena) {
|
2017-01-20 10:15:45 +08:00
|
|
|
return base_ind_get(arena->base);
|
2017-01-11 10:06:31 +08:00
|
|
|
}
|
|
|
|
|
2017-04-22 00:37:34 +08:00
|
|
|
static inline void
|
2017-01-16 08:56:30 +08:00
|
|
|
arena_internal_add(arena_t *arena, size_t size) {
|
2017-03-14 07:18:40 +08:00
|
|
|
atomic_fetch_add_zu(&arena->stats.internal, size, ATOMIC_RELAXED);
|
2017-01-11 10:06:31 +08:00
|
|
|
}
|
|
|
|
|
2017-04-22 00:37:34 +08:00
|
|
|
static inline void
|
2017-01-16 08:56:30 +08:00
|
|
|
arena_internal_sub(arena_t *arena, size_t size) {
|
2017-03-14 07:18:40 +08:00
|
|
|
atomic_fetch_sub_zu(&arena->stats.internal, size, ATOMIC_RELAXED);
|
2017-01-11 10:06:31 +08:00
|
|
|
}
|
|
|
|
|
2017-04-22 00:37:34 +08:00
|
|
|
static inline size_t
|
2017-01-16 08:56:30 +08:00
|
|
|
arena_internal_get(arena_t *arena) {
|
2017-03-14 07:18:40 +08:00
|
|
|
return atomic_load_zu(&arena->stats.internal, ATOMIC_RELAXED);
|
2017-01-11 10:06:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* JEMALLOC_INTERNAL_ARENA_INLINES_A_H */
|