Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
2421 Discussions

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

Victor_Z_
Beginner
130 Views
0 Kudos
1 Reply
Victor_Z_
Beginner
130 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.

Reply