Ignore:
Timestamp:
Nov 5, 2015, 4:41:37 PM (4 years ago)
Author:
nmedfort
Message:

Back up check in. Memory leaks should be fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/pabloAST.h

    r4856 r4860  
    2525class PabloAST {
    2626    friend class Statement;
     27    friend class StatementList;
    2728    friend class Var;
    2829    friend class If;   
     
    3536
    3637    using Allocator = SlabAllocator<u_int8_t>;
    37     using VectorAllocator = SlabAllocator<PabloAST *>;
     38    using VectorAllocator = Allocator::rebind<PabloAST *>::other;
    3839    using Vector = std::vector<PabloAST*, VectorAllocator>;
    3940    using user_iterator = Vector::iterator;
     
    115116        return mAllocator.allocate(size);
    116117    }
     118
     119    void operator delete (void * ptr) {
     120        mAllocator.deallocate(static_cast<Allocator::value_type *>(ptr));
     121    }
     122
    117123protected:
    118124    inline PabloAST(const ClassTypeId id)
    119125    : mClassTypeId(id)
    120     , mUsers(mVectorAllocator)
     126    , mUsers(reinterpret_cast<VectorAllocator &>(mAllocator))
    121127    {
    122128
     
    148154    const ClassTypeId       mClassTypeId;
    149155    Vector                  mUsers;
    150     static VectorAllocator  mVectorAllocator;
    151156};
    152157
     
    482487    }
    483488
     489    void clear();
     490
    484491    inline void setInsertPoint(Statement * const statement) {
    485492        assert (statement == nullptr || contains(statement));
Note: See TracChangeset for help on using the changeset viewer.