diff options
-rw-r--r-- | common/almalloc.cpp | 43 | ||||
-rw-r--r-- | common/almalloc.h | 8 |
2 files changed, 0 insertions, 51 deletions
diff --git a/common/almalloc.cpp b/common/almalloc.cpp index fbb84479..f94ae8bc 100644 --- a/common/almalloc.cpp +++ b/common/almalloc.cpp @@ -17,15 +17,6 @@ #endif -#ifdef __GNUC__ -#define LIKELY(x) __builtin_expect(!!(x), !0) -#define UNLIKELY(x) __builtin_expect(!!(x), 0) -#else -#define LIKELY(x) (!!(x)) -#define UNLIKELY(x) (!!(x)) -#endif - - void *al_malloc(size_t alignment, size_t size) { assert((alignment & (alignment-1)) == 0); @@ -77,37 +68,3 @@ void al_free(void *ptr) noexcept } #endif } - -size_t al_get_page_size() noexcept -{ - static size_t psize{0u}; - if(UNLIKELY(!psize)) - { -#ifdef HAVE_SYSCONF -#if defined(_SC_PAGESIZE) - if(!psize) psize = sysconf(_SC_PAGESIZE); -#elif defined(_SC_PAGE_SIZE) - if(!psize) psize = sysconf(_SC_PAGE_SIZE); -#endif -#endif /* HAVE_SYSCONF */ -#ifdef _WIN32 - if(!psize) - { - SYSTEM_INFO sysinfo{}; - GetSystemInfo(&sysinfo); - psize = sysinfo.dwPageSize; - } -#endif - if(!psize) psize = alignof(std::max_align_t); - } - return psize; -} - -int al_is_sane_alignment_allocator() noexcept -{ -#if defined(HAVE_ALIGNED_ALLOC) || defined(HAVE_POSIX_MEMALIGN) || defined(HAVE__ALIGNED_MALLOC) - return 1; -#else - return 0; -#endif -} diff --git a/common/almalloc.h b/common/almalloc.h index 7b74b659..df329747 100644 --- a/common/almalloc.h +++ b/common/almalloc.h @@ -12,14 +12,6 @@ void *al_malloc(size_t alignment, size_t size); void *al_calloc(size_t alignment, size_t size); void al_free(void *ptr) noexcept; -size_t al_get_page_size(void) noexcept; - -/** - * Returns non-0 if the allocation function has direct alignment handling. - * Otherwise, the standard malloc is used with an over-allocation and pointer - * offset strategy. - */ -int al_is_sane_alignment_allocator(void) noexcept; #define DEF_NEWDEL(T) \ void *operator new(size_t size) \ |