Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/StaticMessageMemory.cpp')
-rw-r--r--runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/StaticMessageMemory.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/StaticMessageMemory.cpp b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/StaticMessageMemory.cpp
index c7f73870d..d88f10b86 100644
--- a/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/StaticMessageMemory.cpp
+++ b/runtime/org.eclipse.etrice.runtime.cpp/src/common/messaging/StaticMessageMemory.cpp
@@ -30,12 +30,16 @@ StaticMessageMemory::~StaticMessageMemory() {
}
Message* StaticMessageMemory::getMessageBuffer(size_t size) {
- if(size <= m_size && m_msgPool.getSize() > 0) {
- return const_cast<Message*>(m_msgPool.pop());
+ if(size > m_size) {
+ std::cout << "Could not provide message buffer (message too big)!" << std::endl;
+ }
+ else if(m_msgPool.getSize() <= 0) {
+ std::cout << "Could not provide message buffer (message pool is empty)!" << std::endl;
}
else {
- return 0;
+ return const_cast<Message*>(m_msgPool.pop());
}
+ return NULL;
}
void StaticMessageMemory::returnMessageBuffer(const Message* buffer) {

Back to the top