Ignore:
Timestamp:
Nov 22, 2017, 3:32:58 PM (22 months ago)
Author:
nmedfort
Message:

Improvements to memory usage of CCs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/util/slab_allocator.h

    r5240 r5742  
    5151    }
    5252
     53    inline void Reset() {
     54        mAllocator.Reset();
     55    }
     56
    5357    inline SlabAllocator() noexcept {}
    54     inline SlabAllocator(const SlabAllocator &) noexcept { assert (false); }
     58    inline SlabAllocator(const SlabAllocator &) noexcept = delete;
    5559    template <class U> inline SlabAllocator (const SlabAllocator<U> &) noexcept { assert (false); }
    5660private:
     
    6165class ProxyAllocator {
    6266    using LLVMAllocator = typename SlabAllocator<T>::LLVMAllocator;
     67    template<typename U> friend class ProxyAllocator;   
    6368public:
    6469    using value_type = T;
     
    103108    }
    104109
    105     inline ProxyAllocator() noexcept { assert (false); }
    106     inline ProxyAllocator(ProxyAllocator const & a) noexcept : mAllocator(const_cast<LLVMAllocator *>(a.mAllocator)) {}
     110    inline ProxyAllocator() noexcept = delete;
     111    template <class U> inline ProxyAllocator(ProxyAllocator<U> & a) noexcept : mAllocator(a.mAllocator) {}
     112    template <class U> inline ProxyAllocator(ProxyAllocator<U> && a) noexcept : mAllocator(a.mAllocator) {}
    107113    template <class U> inline ProxyAllocator (const SlabAllocator<U> & a) noexcept : mAllocator(const_cast<LLVMAllocator *>(&a.mAllocator)) {}
    108114private:
Note: See TracChangeset for help on using the changeset viewer.