32 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_MEMORY 57 return malloc_usable_size(
data);
61 #elif HAVE_MALLOC_SIZE 63 #include <malloc/malloc.h> 67 return malloc_size(
data);
110 rc = posix_memalign(&result, alignment,
size);
158 char *current_byte =
addr;
159 char *end_byte = (
char *)
addr +
size;
168 M0_CASSERT(
sizeof(current_byte) ==
sizeof(uint64_t));
169 *current_byte = 0xCC;
170 for (current_byte = (
char *)
m0_round_up((uint64_t)current_byte + 1,
172 current_byte < end_byte; current_byte += page_size)
173 *current_byte = 0xCC;
186 rc = madvise(
p,
size, MADV_DONTDUMP);
190 "sysctl -w vm.max_map_count=a_larger_number",
216 return getpagesize();
221 return ffs(getpagesize());
224 #undef M0_TRACE_SUBSYSTEM static struct m0_addb2_philter p
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_arch_alloc_size(void *data)
M0_INTERNAL void m0_free_aligned(void *data, size_t size, unsigned shift)
M0_INTERNAL int m0_arch_pagesize_get(void)
M0_INTERNAL void m0_arch_free_aligned(void *addr, size_t size, unsigned shift)
M0_INTERNAL uint64_t m0_round_up(uint64_t val, uint64_t size)
M0_INTERNAL void m0_free_wired(void *data, size_t size, unsigned shift)
M0_INTERNAL int m0_pagesize_get(void)
M0_INTERNAL void * m0_arch_alloc(size_t size)
M0_INTERNAL int m0_arch_memory_init(void)
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 void * m0_arch_alloc_aligned(size_t alignment, size_t size)
M0_INTERNAL void m0_arch_allocated_zero(void *data, size_t size)
M0_INTERNAL int m0_arch_pageshift_get(void)
M0_INTERNAL void * m0_arch_alloc_wired(size_t size, unsigned shift)
M0_INTERNAL void * m0_alloc_aligned(size_t size, unsigned shift)
M0_INTERNAL void m0_arch_memory_fini(void)
M0_INTERNAL int m0_arch_dont_dump(void *p, size_t size)