From 39c2b18cd484478e633dc062b5f36a2c9544fb51 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 6 Jun 2019 00:42:59 -0700 Subject: Remove a couple unused functions --- common/almalloc.cpp | 43 ------------------------------------------- 1 file changed, 43 deletions(-) (limited to 'common/almalloc.cpp') 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 -} -- cgit v1.2.3