diff --git a/.gitignore b/.gitignore index fb459c31c27f0ed5b326c460a268f17a455342dc..f729f194d4d48a4b049d2acf51669655c6cd2370 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ *.exe *.o *.so +*.a # Packages # ############ diff --git a/src/Memleak_check.cpp b/src/Memleak_check.cpp index 756aaad07e152f4dc8a3e2223d34e9a93bd88f90..0fbe86cdaf6535ffacc8c943a376e125e2174018 100644 --- a/src/Memleak_check.cpp +++ b/src/Memleak_check.cpp @@ -3,7 +3,7 @@ #include "ptr_info.hpp" // counter for allocation of new memory -size_t new_data; +long int new_data; // counter to delete memory size_t delete_data; diff --git a/src/Memleak_check.hpp b/src/Memleak_check.hpp index a6fcda46bd2865e2ce8b2847e6788f175919ea76..45b25bf1b1b693a15dffb23b2fffd2c91a4bbbb4 100644 --- a/src/Memleak_check.hpp +++ b/src/Memleak_check.hpp @@ -34,7 +34,7 @@ typedef unsigned char * byte_ptr; extern long int msg_on_alloc; extern long int thr_on_alloc; extern std::string col_stop; -extern size_t new_data; +extern long int new_data; extern size_t delete_data; extern std::map<byte_ptr,ptr_info> active_ptr; @@ -307,7 +307,7 @@ static bool check_valid(const void * ptr, size_t size_access) { if (active_ptr.size() == 0) { - std::cout << "Error invalid pointer: " << __FILE__ << ":" << __LINE__ << " " << ptr << "\n"; + std::cerr << "Error invalid pointer: " << __FILE__ << ":" << __LINE__ << " " << ptr << "\n"; ACTION_ON_ERROR(MEM_ERROR); return false; } @@ -321,7 +321,7 @@ static bool check_valid(const void * ptr, size_t size_access) { if (process_to_print < 0 || process_to_print == process_v_cl) { - std::cout << "Error invalid pointer: " << __FILE__ << ":" << __LINE__ << " " << ptr << " base allocation id=" << l_b->second.id << "\n"; + std::cerr << "Error invalid pointer: " << __FILE__ << ":" << __LINE__ << " " << ptr << " base allocation id=" << l_b->second.id << "\n"; ACTION_ON_ERROR(MEM_ERROR); } return false; @@ -335,7 +335,7 @@ static bool check_valid(const void * ptr, size_t size_access) { if (process_to_print < 0 || process_to_print == process_v_cl) { - std::cout << "Error invalid pointer: " << __FILE__ << ":" << __LINE__ << " " << ptr << " base allocation id=" << l_b->second.id << "\n"; + std::cerr << "Error invalid pointer: " << __FILE__ << ":" << __LINE__ << " " << ptr << " base allocation id=" << l_b->second.id << "\n"; ACTION_ON_ERROR(MEM_ERROR); } return false; @@ -349,7 +349,7 @@ static bool check_valid(const void * ptr, size_t size_access) { if (process_to_print < 0 || process_to_print == process_v_cl) { - std::cout << "Error invalid pointer: " << __FILE__ << ":" << __LINE__ << " " << ptr << " base allocation id=" << l_b->second.id << "\n"; + std::cerr << "Error invalid pointer: " << __FILE__ << ":" << __LINE__ << " " << ptr << " base allocation id=" << l_b->second.id << "\n"; ACTION_ON_ERROR(MEM_ERROR); } return false; diff --git a/src/memory/HeapMemory.cpp b/src/memory/HeapMemory.cpp index 1ed812a233373f910c7a4cec6f7ce45b60d7774c..82d44f6a4f0e96d09192c3ffd236db3bc2157e39 100644 --- a/src/memory/HeapMemory.cpp +++ b/src/memory/HeapMemory.cpp @@ -169,7 +169,6 @@ bool HeapMemory::resize(size_t sz) byte * tdmOrig; tdmOrig = new byte[sz+alignement]; #ifdef SE_CLASS2 - std::cout << "DIOCANE\n"; check_new(tdmOrig,sz+alignement,HEAPMEMORY_EVENT,0); #endif tdm = tdmOrig;