From 0ed2d2684e5ce5798cde34fbc48799e30148c5ca Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 24 Feb 2019 14:25:42 +1100 Subject: srcclean (nw) --- src/lib/netlist/plib/palloc.h | 102 +++++++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 51 deletions(-) (limited to 'src/lib/netlist/plib/palloc.h') diff --git a/src/lib/netlist/plib/palloc.h b/src/lib/netlist/plib/palloc.h index 6380a4cef07..44f3bdb395e 100644 --- a/src/lib/netlist/plib/palloc.h +++ b/src/lib/netlist/plib/palloc.h @@ -34,13 +34,13 @@ namespace plib { #if defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER) return _aligned_malloc(size, alignment); #elif defined(__APPLE__) - void* p; - if (::posix_memalign(&p, alignment, size) != 0) { - p = nullptr; - } - return p; + void* p; + if (::posix_memalign(&p, alignment, size) != 0) { + p = nullptr; + } + return p; #else - return aligned_alloc(alignment, size); + return aligned_alloc(alignment, size); #endif } @@ -59,7 +59,7 @@ namespace plib { static_assert(is_pow2(ALIGN), "Alignment must be a power of 2"); //auto t = reinterpret_cast(p); //if (t & (ALIGN-1)) - // printf("alignment error!"); + // printf("alignment error!"); return reinterpret_cast(__builtin_assume_aligned(p, ALIGN)); } @@ -124,8 +124,8 @@ namespace plib { constexpr pdefault_deleter() noexcept = default; template::value>::type> - pdefault_deleter(const pdefault_deleter&) noexcept { } + std::enable_if::value>::type> + pdefault_deleter(const pdefault_deleter&) noexcept { } void operator()(T *p) const { @@ -249,62 +249,62 @@ namespace plib { class aligned_allocator { public: - using value_type = T; + using value_type = T; - static_assert(ALIGN >= alignof(T) && (ALIGN % alignof(T)) == 0, - "ALIGN must be greater than alignof(T) and a multiple"); + static_assert(ALIGN >= alignof(T) && (ALIGN % alignof(T)) == 0, + "ALIGN must be greater than alignof(T) and a multiple"); - aligned_allocator() noexcept = default; - ~aligned_allocator() noexcept = default; + aligned_allocator() noexcept = default; + ~aligned_allocator() noexcept = default; - aligned_allocator(const aligned_allocator&) noexcept = default; - aligned_allocator& operator=(const aligned_allocator&) noexcept = delete; + aligned_allocator(const aligned_allocator&) noexcept = default; + aligned_allocator& operator=(const aligned_allocator&) noexcept = delete; - aligned_allocator(aligned_allocator&&) noexcept = default; - aligned_allocator& operator=(aligned_allocator&&) = delete; + aligned_allocator(aligned_allocator&&) noexcept = default; + aligned_allocator& operator=(aligned_allocator&&) = delete; - template - aligned_allocator(const aligned_allocator& rhs) noexcept - { - unused_var(rhs); - } + template + aligned_allocator(const aligned_allocator& rhs) noexcept + { + unused_var(rhs); + } - template struct rebind + template struct rebind { - using other = aligned_allocator; + using other = aligned_allocator; }; - T* allocate(std::size_t n) - { - return reinterpret_cast(paligned_alloc(ALIGN, sizeof(T) * n)); - } + T* allocate(std::size_t n) + { + return reinterpret_cast(paligned_alloc(ALIGN, sizeof(T) * n)); + } - void deallocate(T* p, std::size_t n) noexcept - { - unused_var(n); - pfree(p); - } + void deallocate(T* p, std::size_t n) noexcept + { + unused_var(n); + pfree(p); + } - template - friend bool operator==(const aligned_allocator& lhs, - const aligned_allocator& rhs) noexcept; + template + friend bool operator==(const aligned_allocator& lhs, + const aligned_allocator& rhs) noexcept; - template friend class aligned_allocator; + template friend class aligned_allocator; }; - template - /*friend*/ inline bool operator==(const aligned_allocator& lhs, - const aligned_allocator& rhs) noexcept - { - unused_var(lhs, rhs); - return A1 == A2; - } - template - /*friend*/ inline bool operator!=(const aligned_allocator& lhs, - const aligned_allocator& rhs) noexcept - { - return !(lhs == rhs); - } + template + /*friend*/ inline bool operator==(const aligned_allocator& lhs, + const aligned_allocator& rhs) noexcept + { + unused_var(lhs, rhs); + return A1 == A2; + } + template + /*friend*/ inline bool operator!=(const aligned_allocator& lhs, + const aligned_allocator& rhs) noexcept + { + return !(lhs == rhs); + } // FIXME: needs to be somewhere else #if 0 -- cgit v1.2.3-70-g09d2