2008-10-21 16:00:00 +02:00
|
|
|
#include "new"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
const std::nothrow_t std::nothrow = {};
|
|
|
|
|
|
|
|
void* operator new(std::size_t size)
|
|
|
|
{
|
|
|
|
void* p = malloc(size);
|
|
|
|
if (p == NULL) {
|
2011-06-14 21:58:55 +02:00
|
|
|
abort();
|
2008-10-21 16:00:00 +02:00
|
|
|
}
|
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
|
|
|
void* operator new[](std::size_t size)
|
|
|
|
{
|
|
|
|
void* p = malloc(size);
|
|
|
|
if (p == NULL) {
|
2011-06-14 21:58:55 +02:00
|
|
|
abort();
|
2008-10-21 16:00:00 +02:00
|
|
|
}
|
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
|
|
|
void operator delete(void* ptr)
|
|
|
|
{
|
2010-01-31 01:26:30 +01:00
|
|
|
free(ptr);
|
2008-10-21 16:00:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void operator delete[](void* ptr)
|
|
|
|
{
|
2010-01-31 01:26:30 +01:00
|
|
|
free(ptr);
|
2008-10-21 16:00:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void* operator new(std::size_t size, const std::nothrow_t&)
|
|
|
|
{
|
|
|
|
return malloc(size);
|
|
|
|
}
|
|
|
|
|
|
|
|
void* operator new[](std::size_t size, const std::nothrow_t&)
|
|
|
|
{
|
|
|
|
return malloc(size);
|
|
|
|
}
|
|
|
|
|
|
|
|
void operator delete(void* ptr, const std::nothrow_t&)
|
|
|
|
{
|
2010-01-31 01:26:30 +01:00
|
|
|
free(ptr);
|
2008-10-21 16:00:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void operator delete[](void* ptr, const std::nothrow_t&)
|
|
|
|
{
|
2010-01-31 01:26:30 +01:00
|
|
|
free(ptr);
|
2008-10-21 16:00:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|