mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-05-29 15:34:08 +02:00
Fixed delete free mismatch problem in C++11 version.
This commit is contained in:
parent
3b7a2f8f32
commit
a951ea90b8
@ -168,6 +168,24 @@ public:
|
||||
void swap(zone& o);
|
||||
|
||||
|
||||
static void* operator new(std::size_t size) throw(std::bad_alloc)
|
||||
{
|
||||
void* p = ::malloc(size);
|
||||
if (!p) throw std::bad_alloc();
|
||||
return p;
|
||||
}
|
||||
static void operator delete(void *p) throw()
|
||||
{
|
||||
::free(p);
|
||||
}
|
||||
static void* operator new(std::size_t size, void* mem) throw()
|
||||
{
|
||||
return mem;
|
||||
}
|
||||
static void operator delete(void *p, void* mem) throw()
|
||||
{
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
T* allocate(Args... args);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user