Merge pull request #61 from redboltz/fix_delete_free_mismatch

Fixed the free and delete mismatch problem.
This commit is contained in:
Nobuyuki Kubota 2014-02-07 20:04:57 +09:00
commit ca24e040c4

View File

@ -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(', ')%>);