#define XERR "memoryaccess"
#include "memoryaccess.ih"

    // by extend.cc

void MemoryAccess::cpFrom(MemoryAccess &old)
{
    d_idx       =    old.d_idx;
    d_blockStep =    old.d_blockStep;

        // blockSize, id, access, nBlocks: set by the constructor

    d_blockBegin =   old.d_blockBegin;
    d_blockEnd =     old.d_blockEnd;
    d_writtenUntil = old.d_writtenUntil;
    d_maxEnd =       old.d_maxEnd;
    d_data =         old.d_data;

    for (size_t idx = 0; idx != d_nBlocks; ++idx)   // cp the info of the
        d_block[idx] = move(old.d_block[idx]);      // available blocks

                                                    // initialize the new
                                                    // blocks
    fill(d_block + old.d_nBlocks, d_block + d_nBlocks, -1);
}
