Ignore:
Timestamp:
Dec 28, 2016, 7:21:28 PM (2 years ago)
Author:
nmedfort
Message:

Cleaned up memory leaks + some warning messages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/re/re_re.h

    r5091 r5240  
    3737class RE {
    3838public:
    39     using Allocator = SlabAllocator<u_int8_t>;
    40     using VectorAllocator = SlabAllocator<RE *>;
     39    using Allocator = SlabAllocator<RE *>;
     40    using VectorAllocator = ProxyAllocator<RE *>;
    4141    enum class ClassTypeId : unsigned {
    4242        Alt
     
    6565    }
    6666    void* operator new (std::size_t size) noexcept {
    67         return mAllocator.allocate(size);
     67        return mAllocator.allocate<uint8_t>(size);
    6868    }
    6969    const ClassTypeId mClassTypeId;
    7070
    7171    static Allocator mAllocator;
    72     static VectorAllocator mVectorAllocator;
    7372};
    7473
    7574class Vector : public RE, public std::vector<RE*, RE::VectorAllocator> {
    7675public:
    77 
    78     virtual ~Vector() {
    79     }
     76    virtual ~Vector() {}
    8077protected:
    8178    inline Vector(const ClassTypeId id)
    8279    : RE(id)
    83     , std::vector<RE*, RE::VectorAllocator>(mVectorAllocator)
     80    , std::vector<RE*, RE::VectorAllocator>(mAllocator)
    8481    {
    8582
     
    8784    inline Vector(const ClassTypeId id, const iterator begin, const iterator end)
    8885    : RE(id)
    89     , std::vector<RE*, RE::VectorAllocator>(begin, end, mVectorAllocator) {
     86    , std::vector<RE*, RE::VectorAllocator>(begin, end, mAllocator) {
    9087
    9188    }
Note: See TracChangeset for help on using the changeset viewer.