mirror of
https://github.com/ioacademy-jikim/debugging
synced 2025-06-08 00:16:11 +00:00
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;
|
|
}
|
|
|