Hacker News new | past | comments | ask | show | jobs | submit login

> The C++ delete[] operator doesn't take a size parameter either

Yes it does. See overload 6 here

http://en.cppreference.com/w/cpp/memory/new/operator_delete




Note that the size parameter is ignored by the standard library implementation. It is intended for use by user-defined implementations.


> Note that the size parameter is ignored by the standard library implementation

Only because they all call malloc() and free() under the covers. It was however an ABI break, and one the C++ community thought worth doing.

If you replace your malloc with jemalloc you can easily wire this up to sdallocx(). The C++ standard library obviously can't do this out of the box because it can't assume you are using jemalloc




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: