chunk_mmap.c (234370) | chunk_mmap.c (234543) |
---|---|
1#define JEMALLOC_CHUNK_MMAP_C_ 2#include "jemalloc/internal/jemalloc_internal.h" 3 4/******************************************************************************/ 5/* Data. */ 6 7/* 8 * Used by chunk_alloc_mmap() to decide whether to attempt the fast path and --- 58 unchanged lines hidden (view full) --- 67 68 buferror(errno, buf, sizeof(buf)); 69 malloc_printf("<jemalloc>: Error in munmap(): %s\n", buf); 70 if (opt_abort) 71 abort(); 72 } 73} 74 | 1#define JEMALLOC_CHUNK_MMAP_C_ 2#include "jemalloc/internal/jemalloc_internal.h" 3 4/******************************************************************************/ 5/* Data. */ 6 7/* 8 * Used by chunk_alloc_mmap() to decide whether to attempt the fast path and --- 58 unchanged lines hidden (view full) --- 67 68 buferror(errno, buf, sizeof(buf)); 69 malloc_printf("<jemalloc>: Error in munmap(): %s\n", buf); 70 if (opt_abort) 71 abort(); 72 } 73} 74 |
75void 76pages_purge(void *addr, size_t length) 77{ 78 79#ifdef JEMALLOC_PURGE_MADVISE_DONTNEED 80# define JEMALLOC_MADV_PURGE MADV_DONTNEED 81#elif defined(JEMALLOC_PURGE_MADVISE_FREE) 82# define JEMALLOC_MADV_PURGE MADV_FREE 83#else 84# error "No method defined for purging unused dirty pages." 85#endif 86 madvise(addr, length, JEMALLOC_MADV_PURGE); 87} 88 |
|
75static void * 76chunk_alloc_mmap_slow(size_t size, size_t alignment, bool unaligned) 77{ 78 void *ret, *pages; 79 size_t alloc_size, leadsize, trailsize; 80 81 alloc_size = size + alignment - PAGE; 82 /* Beware size_t wrap-around. */ --- 125 unchanged lines hidden --- | 89static void * 90chunk_alloc_mmap_slow(size_t size, size_t alignment, bool unaligned) 91{ 92 void *ret, *pages; 93 size_t alloc_size, leadsize, trailsize; 94 95 alloc_size = size + alignment - PAGE; 96 /* Beware size_t wrap-around. */ --- 125 unchanged lines hidden --- |