made it work for gotthard

This commit is contained in:
Dhanya Maliakal
2017-03-09 11:40:48 +01:00
parent 0dccd78567
commit 86018684c9
8 changed files with 59 additions and 36 deletions

View File

@ -27,7 +27,7 @@ Fifo::Fifo(uint32_t fifoItemSize, uint32_t fifoDepth, bool &success):
Fifo::~Fifo() {
FILE_LOG (logDEBUG) << __AT__ << " called";
cprintf(RED,"destroying fifos\n");
cprintf(BLUE,"Fifo Object %d: Goodbye\n", index);
DestroyFifos();
NumberofFifoClassObjects--;
}
@ -47,6 +47,7 @@ int Fifo::CreateFifos(uint32_t fifoItemSize, uint32_t fifoDepth) {
memory = (char*) calloc (fifoItemSize * fifoDepth, sizeof(char));
if (memory == NULL){
FILE_LOG (logERROR) << "Could not allocate memory for fifos";
memory = 0;
return FAIL;
}
@ -69,6 +70,11 @@ int Fifo::CreateFifos(uint32_t fifoItemSize, uint32_t fifoDepth) {
void Fifo::DestroyFifos(){
FILE_LOG (logDEBUG) << __AT__ << " called";
if(memory) {
free(memory);
memory = 0;
}
if (fifoBound) {
delete fifoBound;
fifoBound = 0;
@ -81,10 +87,6 @@ void Fifo::DestroyFifos(){
delete fifoStream;
fifoStream = 0;
}
if(memory) {
free(memory);
memory = 0;
}
}