From a1c9250ca9cd32971b9f253f7763b0a7701462cd Mon Sep 17 00:00:00 2001
From: Pietro Incardona <i-bird@localhost.localdomain>
Date: Mon, 23 Nov 2015 05:17:28 -0500
Subject: [PATCH] Adjustment for SE_CLASS2

---
 src/Memleak_check.hpp | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/Memleak_check.hpp b/src/Memleak_check.hpp
index 202f8aa..a6fcda4 100644
--- a/src/Memleak_check.hpp
+++ b/src/Memleak_check.hpp
@@ -129,6 +129,12 @@ inline static void get_color(size_t project_id, size_t size, std::string & col)
 	}
 }
 
+/*! \brief Given the structure id it convert to a human readable structure string
+ *
+ * \param project_id id of the project
+ * \param prj string that identify the project
+ *
+ */
 inline static void get_structure(size_t struct_id, std::string & str)
 {
 	switch (struct_id)
@@ -162,6 +168,13 @@ inline static void get_structure(size_t struct_id, std::string & str)
 	}
 }
 
+
+/*! \brief Given the project id it convert to a human readable project string
+ *
+ * \param project_id id of the project
+ * \param prj string that identify the project
+ *
+ */
 inline static void get_project(size_t project_id, std::string & prj)
 {
 	switch (project_id)
@@ -184,9 +197,9 @@ inline static void get_project(size_t project_id, std::string & prj)
 	}
 }
 
-/*! \brief Print all active pointer
+/*! \brief Print all active structures
  *
- * Print all active pointer
+ * Print all active structures
  *
  */
 static void print_alloc()
@@ -251,6 +264,9 @@ static bool check_new(const void * data, size_t sz, size_t struct_id, size_t pro
 	if  (msg_on_alloc == new_data)
 		std::cout << "Detected allocation: " << __FILE__ << ":" << __LINE__ << " id=" << msg_on_alloc << "\n";
 
+	if (thr_on_alloc == new_data)
+		throw MEM_ERROR;
+
 	return true;
 }
 
-- 
GitLab