Taking RISC-V to the next level!

IAR Embedded Workbench for RISC-V now released

Tools for Risc-V

Handle C++ "new" memory exhaustion

Technical Note 92391



10/16/2015 7:53 AM


When new runs out of memory, I get a call to abort or an exception.

I want it to return NULL.

Possible solution

Use the nothrow variant of new as illustrated in provided Screen dumps and Example ProjectExample IAR Embedded Workbench for ARM 7.20.zip.


See section USING NEW HANDLERS in the compiler guide, for example "IAR C/C++ Development Guide" for ARM (page 186 in Part number: DARM-12), for related info.


All product names are trademarks or registered trademarks of their respective owners.

Related Tech Notes

© IAR Systems 1995-2019 - All rights reserved.

We use cookies on this website to provide you with a better experience. You need to accept cookies to continue using this site. Cookies