From d9b88ea7d25f91ca43020e327a9e4bd2eb0d6b06 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Mon, 27 Jan 2020 20:10:49 +0100 Subject: [PATCH] performance optimization in fifodepth, ensure memory is allocated by writing something in the beginning --- slsReceiverSoftware/src/Fifo.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/slsReceiverSoftware/src/Fifo.cpp b/slsReceiverSoftware/src/Fifo.cpp index bb37de5f5..0ad833966 100755 --- a/slsReceiverSoftware/src/Fifo.cpp +++ b/slsReceiverSoftware/src/Fifo.cpp @@ -51,6 +51,10 @@ void Fifo::CreateFifos(uint32_t fifoItemSize) { throw sls::RuntimeError("Could not allocate memory for fifos"); } memset(memory, 0, mem_len); + int pagesize = getpagesize(); + for (size_t i = 0; i < mem_len; i += pagesize) { + strcpy(memory + i, "memory"); + } FILE_LOG(logDEBUG) << "Memory Allocated " << index << ": " << (double)mem_len/(1000.00 * 1000.00) << " Mb"; { //push free addresses into fifoFree fifo