Details
-
Bug
-
Resolution: Fixed
-
Major
-
Morpheus
-
None
-
Untriaged
-
0
-
Unknown
Description
maloc_usable_size should be used to get the size of the underlying allocation returned from "malloc with friends". There is no guarantee that it would work with a pointer returned from the new operator (according to various searches it is "undefined')
"Note that applying malloc_usable_size (or _msize) to the result of new is undefined behavior." (https://stackoverflow.com/questions/54783860/getting-size-of-dynamic-c-style-array-vs-use-of-delete-contradiction