mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 03:40:04 +02:00
bugfix: high fifo depth more than 32 bit
This commit is contained in:
parent
2314fdabd1
commit
a0208778c1
@ -45,13 +45,13 @@ void Fifo::CreateFifos(uint32_t fifoItemSize) {
|
|||||||
fifoFree = new CircularFifo<char>(fifoDepth);
|
fifoFree = new CircularFifo<char>(fifoDepth);
|
||||||
fifoStream = new CircularFifo<char>(fifoDepth);
|
fifoStream = new CircularFifo<char>(fifoDepth);
|
||||||
//allocate memory
|
//allocate memory
|
||||||
size_t mem_len = fifoItemSize * fifoDepth * sizeof(char);
|
size_t mem_len = (size_t)fifoItemSize * (size_t)fifoDepth * sizeof(char);
|
||||||
memory = (char*) malloc (mem_len);
|
memory = (char*) malloc (mem_len);
|
||||||
if (memory == nullptr){
|
if (memory == nullptr){
|
||||||
throw sls::RuntimeError("Could not allocate memory for fifos");
|
throw sls::RuntimeError("Could not allocate memory for fifos");
|
||||||
}
|
}
|
||||||
memset(memory, 0, mem_len);
|
memset(memory, 0, mem_len);
|
||||||
FILE_LOG(logDEBUG) << "Memory Allocated " << index << ": " << mem_len << " bytes";
|
FILE_LOG(logDEBUG) << "Memory Allocated " << index << ": " << (double)mem_len/(1000.00 * 1000.00) << " Mb";
|
||||||
|
|
||||||
{ //push free addresses into fifoFree fifo
|
{ //push free addresses into fifoFree fifo
|
||||||
char* buffer = memory;
|
char* buffer = memory;
|
||||||
|
@ -193,10 +193,10 @@ void Implementation::SetupFifoStructure() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FILE_LOG(logINFO) << "Memory Allocated Per Fifo: "
|
FILE_LOG(logINFO) << "Memory Allocated Per Fifo: "
|
||||||
<< (((generalData->imageSize) +
|
<< (double)(((generalData->imageSize) +
|
||||||
(generalData->fifoBufferHeaderSize)) *
|
(generalData->fifoBufferHeaderSize)) *
|
||||||
fifoDepth)
|
fifoDepth) / (1000.00 * 1000.00)
|
||||||
<< " bytes";
|
<< " Mb";
|
||||||
FILE_LOG(logINFO) << numThreads << " Fifo structure(s) reconstructed";
|
FILE_LOG(logINFO) << numThreads << " Fifo structure(s) reconstructed";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user