Fix segmentation fault due to calling methods on NULL ReadyBatch Object
This commit is contained in:
@@ -133,6 +133,11 @@ bool SMS::selectSJF(sc_time memClk, std::map<Thread, ReadyBatch*>::iterator &las
|
||||
|
||||
bool SMS::selectRR(sc_time memClk, std::map<Thread, ReadyBatch*>::iterator &nextSelectedThread)
|
||||
{
|
||||
// no request for this channel, the readybatches map is empty then return
|
||||
if (readybatches.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// pick a non-empty ready batch
|
||||
std::map<Thread, ReadyBatch*>::iterator savedOriginalNextSelectedThread = nextSelectedThread;
|
||||
while ((*nextSelectedThread).second->isEmpty())
|
||||
|
||||
@@ -43,6 +43,7 @@ class TracePlayerListener
|
||||
public:
|
||||
virtual void tracePlayerTerminates() = 0;
|
||||
virtual void transactionFinished() = 0;
|
||||
virtual ~TracePlayerListener(){};
|
||||
};
|
||||
|
||||
#endif // TRACEPLAYERLISTENER_H
|
||||
|
||||
@@ -53,6 +53,7 @@ public:
|
||||
|
||||
virtual void tracePlayerTerminates() override;
|
||||
virtual void transactionFinished() override;
|
||||
virtual ~traceSetup(){};
|
||||
|
||||
private:
|
||||
unsigned int NumberOfTracePlayers;
|
||||
|
||||
Reference in New Issue
Block a user