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

// disconnect(id) (1.) disconnects block[idx] if it's != 0, detaching d_data
// disconnect(ptr) (2.) disconnects the MemoryAccess object at 'ptr' itself

    // by activate.cc, drop.cc

void MemoryAccess::disconnect(size_t idx)
{
    if (idx == s_noBlock or d_block[idx] == -1)            // not connected
        return;

    if (shmdt(d_data) != 0)
       emsg << XERR ": Could not disconnect block " << idx << " (id: " <<
                d_block[idx] << ')' << endl;
}
