Skip to content
Snippets Groups Projects
Commit 59986123 authored by Christian Engwer's avatar Christian Engwer
Browse files

[debugallocator]

check scoped new/delete

[[Imported from SVN: r7011]]
parent 6e5874cf
No related branches found
No related tags found
No related merge requests found
...@@ -280,6 +280,7 @@ void operator delete(void * p) throw() ...@@ -280,6 +280,7 @@ void operator delete(void * p) throw()
#endif #endif
Dune::DebugMemory::alloc_man.deallocate<char>(static_cast<char*>(p)); Dune::DebugMemory::alloc_man.deallocate<char>(static_cast<char*>(p));
} }
#endif // DEBUG_NEW_DELETE #endif // DEBUG_NEW_DELETE
#endif // DUNE_DEBUG_ALLOCATOR_HH #endif // DUNE_DEBUG_ALLOCATOR_HH
...@@ -79,6 +79,12 @@ void new_delete_tests() ...@@ -79,6 +79,12 @@ void new_delete_tests()
z2->foo(); z2->foo();
free(buf); free(buf);
z2 = 0; z2 = 0;
std::cout << "alloc A[4]\n";
A * z4 = ::new A[4];
z4->foo();
::delete[] z4;
z4 = 0;
} }
int main(int argc, char** argv) int main(int argc, char** argv)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment