Add std::nothrow when using operator new

This commit is contained in:
Tristan Penman 2022-09-12 13:02:34 +10:00
parent e895d035dc
commit db8daacc32
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ public:
};
CustomAllocator()
: m_allocFn(::operator new),
: m_allocFn([](size_t size) { return ::operator new(size, std::nothrow); }),
m_freeFn(::operator delete) { }
CustomAllocator(CustomAlloc allocFn, CustomFree freeFn)

View File

@ -47,7 +47,7 @@ public:
* @brief Construct a new Subschema object
*/
Subschema()
: m_allocFn(::operator new)
: m_allocFn([](size_t size) { return ::operator new(size, std::nothrow); })
, m_freeFn(::operator delete)
, m_alwaysInvalid(false) { }