From 9817279ee3ac36b435d2178e994ab314a01aab30 Mon Sep 17 00:00:00 2001
From: Pietro Incardona <incardon@mpi-cbg.de>
Date: Sat, 3 Jun 2017 13:05:10 +0200
Subject: [PATCH] Small bug fixes

---
 src/memory/BHeapMemory.hpp | 6 +++---
 src/memory/HeapMemory.hpp  | 2 +-
 src/util/print_stack.hpp   | 4 ++++
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/memory/BHeapMemory.hpp b/src/memory/BHeapMemory.hpp
index 1520379..eded629 100644
--- a/src/memory/BHeapMemory.hpp
+++ b/src/memory/BHeapMemory.hpp
@@ -26,10 +26,10 @@ typedef unsigned char byte;
  *
  * It differs from HeapMemory in resize behavior.
  *
- * In the case of HeapMemory if you try to shrink the memory nothing happen to the allocated memory.
+ * In the case of BHeapMemory if you try to shrink the memory nothing happen to the allocated memory.
  * To destroy the internal memory you must use destroy.
  *
- * BHeapMemory does not shrink the memory, but it shrink the buffer size. size will always return the buffer size
+ * BHeapMemory does not shrink the memory, but it shrink the buffer size. size() always return the buffer size
  *
  * ### Allocate memory
  *
@@ -66,7 +66,7 @@ public:
 	:HeapMemory(),buf_sz(0)
 	{};
 
-	virtual ~BHeapMemory()
+	virtual ~BHeapMemory() noexcept
 	{
 	};
 
diff --git a/src/memory/HeapMemory.hpp b/src/memory/HeapMemory.hpp
index 9b5ceba..94557cd 100644
--- a/src/memory/HeapMemory.hpp
+++ b/src/memory/HeapMemory.hpp
@@ -138,7 +138,7 @@ public:
 	//! Constructor, we choose a default alignment of 32 for avx
 	HeapMemory():alignement(MEM_ALIGNMENT),sz(0),dm(NULL),dmOrig(NULL),ref_cnt(0) {};
 
-	virtual ~HeapMemory()
+	virtual ~HeapMemory() noexcept
 	{
 		if(ref_cnt == 0)
 			HeapMemory::destroy();
diff --git a/src/util/print_stack.hpp b/src/util/print_stack.hpp
index ed46c12..68a1130 100644
--- a/src/util/print_stack.hpp
+++ b/src/util/print_stack.hpp
@@ -119,6 +119,10 @@ static inline void print_stack()
 
 	std::cerr << str.str() << std::endl;
 
+#else
+
+	std::cerr << "Stack trace deactivated" << std::endl;
+
 #endif
 }
 
-- 
GitLab