Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heapchecker does not detect mismatched delete #474

Closed
alk opened this issue Aug 23, 2015 · 3 comments
Closed

Heapchecker does not detect mismatched delete #474

alk opened this issue Aug 23, 2015 · 3 comments

Comments

@alk
Copy link
Contributor

alk commented Aug 23, 2015

Originally reported on Google Code with ID 471

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

Reported by oscarl on 2012-10-15 18:25:24

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

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 :)

Reported by chappedm on 2012-10-29 12:40:53

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

Reported by chappedm on 2012-11-04 18:25:53

  • Status changed: Accepted

@alk
Copy link
Contributor Author

alk commented Feb 22, 2016

debug malloc will detect this mismatch.

@alk alk closed this as completed Feb 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant