diff --git a/threadeddyscocolumn.cc b/threadeddyscocolumn.cc index 732fe39..a2ec16b 100644 --- a/threadeddyscocolumn.cc +++ b/threadeddyscocolumn.cc @@ -168,7 +168,10 @@ void ThreadedDyscoColumn::storeBlock() { template void ThreadedDyscoColumn::putValues( - casacore::uInt rowNr, const casacore::Array *dataPtr) { + casacore::uInt rowNr, const casacore::Array *dataArr) { + // Make sure array storage is contiguous. + casacore::Bool deleteIt; + const DataType* dataPtr = dataArr->getStorage (deleteIt); if (!areOffsetsInitialized()) { // If the manager did not initialize its offsets yet, then it is determined // from the first "time block" (a block with the same time, field and spw) @@ -207,11 +210,12 @@ void ThreadedDyscoColumn::putValues( // Load new block loadBlock(blockIndex); } - _timeBlockBuffer->SetData(blockRow, ant1, ant2, dataPtr->data()); + _timeBlockBuffer->SetData(blockRow, ant1, ant2, dataPtr); } else { - _timeBlockBuffer->SetData(rowNr, ant1, ant2, dataPtr->data()); + _timeBlockBuffer->SetData(rowNr, ant1, ant2, dataPtr); } _isCurrentBlockChanged = true; + dataArr->freeStorage (dataPtr, deleteIt); } template diff --git a/threadeddyscocolumn.h b/threadeddyscocolumn.h index f5519f9..3087564 100644 --- a/threadeddyscocolumn.h +++ b/threadeddyscocolumn.h @@ -24,7 +24,7 @@ namespace dyscostman { class DyscoStMan; /** - * A column for storing compressed values in a threaded way, tailered for the + * A column for storing compressed values in a threaded way, tailored for the * data and weight columns that use a threaded approach for encoding. * @author André Offringa */