2017-01-11 10:06:31 +08:00
|
|
|
#ifndef JEMALLOC_INTERNAL_EXTENT_INLINES_H
|
|
|
|
#define JEMALLOC_INTERNAL_EXTENT_INLINES_H
|
2010-01-17 01:53:50 +08:00
|
|
|
|
2017-05-24 03:28:19 +08:00
|
|
|
#include "jemalloc/internal/mutex.h"
|
2017-05-24 05:56:24 +08:00
|
|
|
#include "jemalloc/internal/mutex_pool.h"
|
2017-04-25 09:05:15 +08:00
|
|
|
#include "jemalloc/internal/pages.h"
|
2017-04-20 03:48:50 +08:00
|
|
|
#include "jemalloc/internal/prng.h"
|
2017-04-11 08:11:33 +08:00
|
|
|
#include "jemalloc/internal/ql.h"
|
2017-12-15 04:46:39 +08:00
|
|
|
#include "jemalloc/internal/sc.h"
|
2017-05-31 01:45:37 +08:00
|
|
|
#include "jemalloc/internal/sz.h"
|
2017-04-11 08:11:33 +08:00
|
|
|
|
2017-05-16 05:23:51 +08:00
|
|
|
static inline void
|
|
|
|
extent_lock(tsdn_t *tsdn, extent_t *extent) {
|
|
|
|
assert(extent != NULL);
|
|
|
|
mutex_pool_lock(tsdn, &extent_mutex_pool, (uintptr_t)extent);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
extent_unlock(tsdn_t *tsdn, extent_t *extent) {
|
|
|
|
assert(extent != NULL);
|
|
|
|
mutex_pool_unlock(tsdn, &extent_mutex_pool, (uintptr_t)extent);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
extent_lock2(tsdn_t *tsdn, extent_t *extent1, extent_t *extent2) {
|
|
|
|
assert(extent1 != NULL && extent2 != NULL);
|
|
|
|
mutex_pool_lock2(tsdn, &extent_mutex_pool, (uintptr_t)extent1,
|
|
|
|
(uintptr_t)extent2);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
extent_unlock2(tsdn_t *tsdn, extent_t *extent1, extent_t *extent2) {
|
|
|
|
assert(extent1 != NULL && extent2 != NULL);
|
|
|
|
mutex_pool_unlock2(tsdn, &extent_mutex_pool, (uintptr_t)extent1,
|
|
|
|
(uintptr_t)extent2);
|
|
|
|
}
|
|
|
|
|
2017-01-11 10:06:31 +08:00
|
|
|
#endif /* JEMALLOC_INTERNAL_EXTENT_INLINES_H */
|