News for hackers. Stuff that matters.
Re:Current hardware trends make C++ exceptions harder to jus... by kevin_thibedeau on Tuesday February 22, 2022 @03:31PM (#30433302)
You also have to abandon operator new and STL unless you want to pretend they never fail.
Re:Current hardware trends make C++ exceptions harder to jus... by jeffbee on Tuesday February 22, 2022 @04:35PM (#30434186)
Right, I use an allocator that just aborts. Imagining your program can recover from alloc failures has always struck me as fanciful, or at least out of the realm of my experience.
Re:Current hardware trends make C++ exceptions harder to jus... by Inityx on Tuesday February 22, 2022 @05:50PM (#30434997)
It's a legitimate thing in embedded and other memory-constrained circumstances, when you have something like a large cache and an allocation failure can trigger manual pruning or GC.
Re:Current hardware trends make C++ exceptions harder to jus... by pjmlp on Wednesday February 23, 2022 @05:06AM (#30439561)
Just use the no_throw variant, no need to abandon new.