3 ms·
How can you catch allocation failure from ::new? Is it possible without exceptions (which have some other problems in kernel space)?
by ibotty 6y ago
How can you catch allocation failure from ::new? Is it possible without exceptions (which have some other problems in kernel space)?
- steerablesafe 6y agoOne can use ::new(std::nothrow), which selects the non-throwing allocation function. Returns nullptr on failure.