yodamaster / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Heapchecker does not detect mismatched delete #471

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The following should detect an error, but is not.

    int * p = new int[10];
    delete p;

Must use delete [] when allocated with new [].  This is seen with gperftools-2.0

Original issue reported on code.google.com by osc...@gmail.com on 15 Oct 2012 at 6:25

GoogleCodeExporter commented 9 years ago
The heap checker will find these memory leaks for you. Not sure how we would do 
detection of this condition without adding additional meta data to the memory 
allocation itself which would negatively impact performance. Pretty sure 
Valgrind will detect these but have you noticed how slow it runs :)

Original comment by chapp...@gmail.com on 29 Oct 2012 at 12:40

GoogleCodeExporter commented 9 years ago

Original comment by chapp...@gmail.com on 4 Nov 2012 at 6:25