esp-open-rtos/core/cplusplus_operators.cpp
Joost Nieuwenhuijse 2985d1d11e Make operator new / delete weak
so you can implement your own, e.g. if you need a throwing operator new.
2018-05-16 17:56:15 +02:00

25 lines
441 B
C++

/* Part of esp-open-rtos
* BSD Licensed as described in the file LICENSE
*/
#include <stdio.h>
#include <stdlib.h>
void * __attribute__((weak)) operator new(size_t size)
{
return malloc(size);
}
void * __attribute__((weak)) operator new[](size_t size)
{
return malloc(size);
}
void __attribute__((weak)) operator delete(void * ptr)
{
free(ptr);
}
void __attribute__((weak)) operator delete[](void * ptr)
{
free(ptr);
}