/* * PSP Software Development Kit - https://github.com/pspdev * ----------------------------------------------------------------------- * Licensed under the BSD license, see LICENSE in PSPSDK root for details. * * cxx.cpp - Simple C++ memory allocation operators. * * Copyright (c) 2005 Marcus R. Brown * Copyright (c) 2005 James Forshaw * Copyright (c) 2005 John Kelley * */ #include #include __attribute__((weak)) void operator delete(void *ptr) { if (ptr) { free(ptr); } } __attribute__((weak)) void* operator new(size_t len) { return malloc(len); } __attribute__((weak)) void operator delete[](void *ptr) { ::operator delete(ptr); } __attribute__((weak)) void* operator new[](size_t len) { return ::operator new(len); } extern "C" __attribute__((weak)) void __cxa_pure_virtual() { /* perror("Pure virtual method called"); */ abort(); }