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

Cleaned up memory leaks + some warning messages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/UCD/unicode_set.cpp

    r5227 r5240  
    4040template <> inline int scan_forward_zeroes<unsigned long long>(unsigned long long x){return __builtin_ctzll(x);}
    4141
    42 
    43 
    44 UnicodeSet::RunAllocator UnicodeSet::mRunAllocator;
    45 UnicodeSet::QuadAllocator UnicodeSet::mQuadAllocator;
     42SlabAllocator<> UnicodeSet::mAllocator;
    4643
    4744const uint64_t QUAD_BITS = (8 * sizeof(bitquad_t));
     
    773770 ** ------------------------------------------------------------------------------------------------------------- */
    774771UnicodeSet::UnicodeSet()
    775 : mRuns(mRunAllocator)
    776 , mQuads(mQuadAllocator)
     772: mRuns(mAllocator)
     773, mQuads(mAllocator)
    777774{
    778775    append_run(Empty, UNICODE_QUAD_COUNT, mRuns);
     
    784781 ** ------------------------------------------------------------------------------------------------------------- */
    785782UnicodeSet::UnicodeSet(const codepoint_t codepoint)
    786 : mRuns(mRunAllocator)
    787 , mQuads(mQuadAllocator)
     783: mRuns(mAllocator)
     784, mQuads(mAllocator)
    788785{
    789786    const codepoint_t quad_no = codepoint / QUAD_BITS;
     
    798795 ** ------------------------------------------------------------------------------------------------------------- */
    799796UnicodeSet::UnicodeSet(const codepoint_t lo, const codepoint_t hi)
    800 : mRuns(mRunAllocator)
    801 , mQuads(mQuadAllocator)
     797: mRuns(mAllocator)
     798, mQuads(mAllocator)
    802799{
    803800    const codepoint_t lo_index = lo / QUAD_BITS;
     
    879876 ** ------------------------------------------------------------------------------------------------------------- */
    880877UnicodeSet::UnicodeSet(std::initializer_list<interval_t>::iterator begin, std::initializer_list<interval_t>::iterator end)
    881 : mRuns(0, {Empty, 0}, mRunAllocator)
    882 , mQuads(0, 0, mQuadAllocator)
    883 {
     878: mRuns(0, {Empty, 0}, mAllocator)
     879, mQuads(0, 0, mAllocator) {
    884880    convertIntervalRangesToSparseSet(begin, end, mRuns, mQuads);
    885881}
     
    889885 ** ------------------------------------------------------------------------------------------------------------- */
    890886UnicodeSet::UnicodeSet(const std::vector<interval_t>::iterator begin, const std::vector<interval_t>::iterator end)
    891 : mRuns(0, {Empty, 0}, mRunAllocator)
    892 , mQuads(0, 0, mQuadAllocator)
    893 {
     887: mRuns(0, {Empty, 0}, mAllocator)
     888, mQuads(0, 0, mAllocator) {
    894889    convertIntervalRangesToSparseSet(begin, end, mRuns, mQuads);
    895890}
     
    899894 ** ------------------------------------------------------------------------------------------------------------- */
    900895UnicodeSet::UnicodeSet(const UnicodeSet & other)
    901 : mRuns(other.mRuns, mRunAllocator)
    902 , mQuads(other.mQuads, mQuadAllocator)
    903 {
     896: mRuns(other.mRuns, mAllocator)
     897, mQuads(other.mQuads, mAllocator) {
    904898    assert (verify(mRuns, mQuads));
    905899}
     
    909903 ** ------------------------------------------------------------------------------------------------------------- */
    910904UnicodeSet::UnicodeSet(std::initializer_list<run_t> r, std::initializer_list<bitquad_t> q)
    911 : mRuns(r.begin(), r.end(), mRunAllocator)
    912 , mQuads(q.begin(), q.end(), mQuadAllocator)
    913 {
     905: mRuns(r.begin(), r.end(), mAllocator)
     906, mQuads(q.begin(), q.end(), mAllocator) {
    914907    assert (verify(mRuns, mQuads));
    915908}
     
    919912 ** ------------------------------------------------------------------------------------------------------------- */
    920913inline UnicodeSet::UnicodeSet(std::vector<run_t> && r, std::vector<bitquad_t> && q)
    921 : mRuns(r.begin(), r.end(), mRunAllocator)
    922 , mQuads(q.begin(), q.end(), mQuadAllocator)
    923 {
     914: mRuns(r.begin(), r.end(), mAllocator)
     915, mQuads(q.begin(), q.end(), mAllocator) {
    924916    assert (verify(mRuns, mQuads));
    925917}
Note: See TracChangeset for help on using the changeset viewer.