mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 18:13:01 +00:00
operator new(unsigned, std::nothrow_t const&) operator new[](unsigned, std::nothrow_t const&) because they weren't being intercepted, and called malloc(), which caused bogus mismatch errors. Added a regression test for it, too. MERGE TO STABLE (although the change to vg_replace_malloc.c won't quite be a cut and paste job, because of prior changes made to it in the head but not the stable branch; merge will still be easy, though) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1899
14 lines
298 B
C++
14 lines
298 B
C++
#include <new>
|
|
|
|
// At one point, Valgrind wasn't overriding these 'nothrow' versions; since
|
|
// they call malloc(), the calls to 'delete' caused bogus mismatch errors.
|
|
|
|
int main()
|
|
{
|
|
int * a = new (std::nothrow) int;
|
|
int * b = new (std::nothrow) int[5];
|
|
delete a;
|
|
delete [] b;
|
|
}
|
|
|