From 82b889f4a26c62c03e95a02f2d83737a2b6ce60b Mon Sep 17 00:00:00 2001 From: Justin Viiret Date: Wed, 5 Apr 2017 15:54:52 +1000 Subject: [PATCH] bytecode_ptr: fix shadow/conversion issues (gcc48) --- src/util/bytecode_ptr.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util/bytecode_ptr.h b/src/util/bytecode_ptr.h index d3f5215a..ace5063c 100644 --- a/src/util/bytecode_ptr.h +++ b/src/util/bytecode_ptr.h @@ -55,11 +55,11 @@ template class bytecode_ptr : totally_ordered> { public: bytecode_ptr() = default; - explicit bytecode_ptr(size_t size, size_t align = alignof(T)) - : bytes(size), alignment(align) { + explicit bytecode_ptr(size_t bytes_in, size_t alignment_in = alignof(T)) + : bytes(bytes_in), alignment(alignment_in) { // posix_memalign doesn't like us asking for smaller alignment. - size_t mem_align = std::max(align, sizeof(void *)); - ptr.reset(static_cast(aligned_malloc_internal(size, mem_align))); + size_t mem_align = std::max(alignment, sizeof(void *)); + ptr.reset(static_cast(aligned_malloc_internal(bytes, mem_align))); if (!ptr) { throw std::bad_alloc(); } @@ -116,7 +116,7 @@ private: void operator()(DT *p) const { aligned_free_internal(p); } }; - std::unique_ptr> ptr = nullptr; //!< Underlying pointer. + std::unique_ptr> ptr; //!< Underlying pointer. size_t bytes = 0; //!< Size of memory region in bytes. size_t alignment = 0; //!< Alignment of memory region in bytes. };