mirror of
https://github.com/tristanpenman/valijson.git
synced 2024-12-14 02:57:45 +01:00
Add std::nothrow when using operator new
This commit is contained in:
parent
e895d035dc
commit
db8daacc32
@ -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)
|
||||
|
@ -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) { }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user