mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-19 13:02:13 +01:00
Merge pull request #61 from redboltz/fix_delete_free_mismatch
Fixed the free and delete mismatch problem.
This commit is contained in:
commit
ca24e040c4
@ -44,7 +44,16 @@ public:
|
||||
void clear();
|
||||
|
||||
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);
|
||||
}
|
||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||
template <typename T<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
||||
T* allocate(<%=(1..i).map{|j|"A#{j} a#{j}"}.join(', ')%>);
|
||||
|
Loading…
x
Reference in New Issue
Block a user