performance optimization in fifodepth, ensure memory is allocated by writing something in the beginning

This commit is contained in:
maliakal_d 2020-01-27 20:10:49 +01:00
parent 9f22c80081
commit d9b88ea7d2

View File

@ -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