Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
2470 Discussions

tbbmalloc operator new should check new_handler's before throwing std::bad_alloc

1 Reply
Victor_Z_
Beginner
360 Views

Oops, it seems like i didn't leave a message properly.

tbbmalloc's operator new and operator new[] overloads in src/tbbmalloc/proxy.cpp go straight to throwing std::bad_alloc if scalable_msize(sz) returns NULL. I have installed a new_handler using std::set_new_handler(handler), and I expect this handler to be called in the new operator when tbbmalloc has run out of memory.

This is an enhancement request for future versions of tbbmalloc.

0 Kudos
Reply