30 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_MEMORY 41 #ifdef ENABLE_DEV_MODE 42 #define DEV_MODE (true) 44 #define DEV_MODE (false) 47 #ifdef ENABLE_FREE_POISON 59 static bool is_poisoned(uint64_t
val)
62 return (
val & 0x00ffffffff000000ULL) == 0x005f5f5f5f000000ULL;
73 return is_poisoned((uint64_t)
p) || is_poisoned(*(
const uint64_t *)
p);
183 alignment =
max_type(
size_t, 1 << shift,
sizeof result);
246 M0_PRE(((
unsigned long)
p / pagesize * pagesize) == (
unsigned long)
p);
269 #undef M0_TRACE_SUBSYSTEM static void ptr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
static struct m0_addb2_philter p
static bool m0_addr_is_aligned(const void *addr, unsigned shift)
M0_INTERNAL void m0_arch_free_wired(void *data, size_t size, unsigned shift)
#define M0_LOG(level,...)
M0_INTERNAL void m0_arch_memory_pagein(void *addr, size_t size)
M0_INTERNAL size_t m0_allocated_total(void)
static void m0_atomic64_sub(struct m0_atomic64 *a, int64_t num)
M0_INTERNAL size_t m0_arch_alloc_size(void *data)
static bool m0_is_po2(uint64_t val)
static void alloc_tail(void *area, size_t size)
M0_INTERNAL void * m0_alloc_wired(size_t size, unsigned shift)
M0_INTERNAL void m0_free_aligned(void *data, size_t size, unsigned shift)
M0_INTERNAL int m0_pageshift_get(void)
static struct m0_atomic64 allocated
M0_INTERNAL int m0_arch_pagesize_get(void)
M0_INTERNAL void m0_arch_free_aligned(void *addr, size_t size, unsigned shift)
M0_INTERNAL size_t m0_allocated(void)
M0_INTERNAL void m0_free_wired(void *data, size_t size, unsigned shift)
M0_INTERNAL int m0_pagesize_get(void)
M0_INTERNAL void * m0_alloc_nz(size_t size)
static struct m0_atomic64 cumulative_free
M0_INTERNAL void * m0_arch_alloc(size_t size)
M0_INTERNAL int m0_dont_dump(void *p, size_t size)
M0_INTERNAL int m0_arch_memory_init(void)
static void poison_before_free(void *data, size_t size)
void * m0_alloc(size_t size)
M0_INTERNAL void m0_arch_free(void *data)
M0_INTERNAL void * m0_arch_alloc_nz(size_t size)
M0_INTERNAL bool m0_is_poisoned(const void *ptr)
M0_INTERNAL void * m0_arch_alloc_aligned(size_t alignment, size_t size)
M0_INTERNAL void m0_memory_fini(void)
static int64_t m0_atomic64_get(const struct m0_atomic64 *a)
M0_INTERNAL void m0_arch_allocated_zero(void *data, size_t size)
M0_INTERNAL size_t m0_freed_total(void)
#define M0_FI_ENABLED(tag)
M0_INTERNAL void m0_memory_pagein(void *addr, size_t size)
M0_INTERNAL int m0_arch_pageshift_get(void)
M0_INTERNAL void * m0_arch_alloc_wired(size_t size, unsigned shift)
#define max_type(t, a, b)
M0_INTERNAL int m0_memory_init(void)
M0_INTERNAL void * m0_alloc_aligned(size_t size, unsigned shift)
static void m0_atomic64_add(struct m0_atomic64 *a, int64_t num)
static struct m0_atomic64 cumulative_alloc
M0_INTERNAL void m0_arch_memory_fini(void)
static void m0_atomic64_set(struct m0_atomic64 *a, int64_t num)
M0_INTERNAL int m0_arch_dont_dump(void *p, size_t size)