mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-06-06 18:48:39 +02:00
Correct calculation of buffer size
This commit is contained in:
@@ -4,9 +4,10 @@ using namespace std;
|
||||
using namespace core_buffer;
|
||||
|
||||
ImageAssembler::ImageAssembler(const size_t n_modules) :
|
||||
n_modules_(n_modules)
|
||||
n_modules_(n_modules),
|
||||
image_buffer_slot_n_bytes_(BUFFER_BLOCK_SIZE * MODULE_N_BYTES * n_modules_)
|
||||
{
|
||||
image_buffer_ = new char[IA_N_SLOTS * MODULE_N_BYTES * n_modules_];
|
||||
image_buffer_ = new char[IA_N_SLOTS * image_buffer_slot_n_bytes_];
|
||||
metadata_buffer_ = new ImageMetadataBlock[IA_N_SLOTS];
|
||||
}
|
||||
|
||||
@@ -46,5 +47,5 @@ ImageMetadataBlock* ImageAssembler::get_metadata_buffer(const int slot_id)
|
||||
|
||||
char* ImageAssembler::get_data_buffer(const int slot_id)
|
||||
{
|
||||
return image_buffer_ + (slot_id * MODULE_N_BYTES * n_modules_);
|
||||
return image_buffer_ + (slot_id * image_buffer_slot_n_bytes_);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ const size_t IA_N_SLOTS = 2;
|
||||
|
||||
class ImageAssembler {
|
||||
const size_t n_modules_;
|
||||
const size_t image_buffer_slot_n_bytes_;
|
||||
|
||||
char* image_buffer_;
|
||||
ImageMetadataBlock* metadata_buffer_;
|
||||
|
||||
Reference in New Issue
Block a user