elehcim / gperftools

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

recalloc is wrong in windows/override_functions.cc #682

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
According to http://en.cppreference.com/w/c/memory/realloc (and many other 
manuals), realloc is not supposed to zero all allocated memory, only the newly 
allocated memory.

You can see the zeroing of memory here:
https://code.google.com/p/gperftools/source/browse/src/windows/override_function
s.cc#57
which only exists in the override implementation on Windows

What version of the product are you using? On what operating system?
GPerfTools 2.4

Original issue reported on code.google.com by mark.ben...@10gen.com on 21 Apr 2015 at 9:17

GoogleCodeExporter commented 9 years ago
This is actually recalloc not realloc. But it is wrong indeed.

Thanks for reporting it. If you can submit a patch for that issue that would be 
great too :)

Original comment by alkondratenko on 25 Apr 2015 at 11:09