3 * Iter Vehemens ad Necem (IVAN)
4 * Copyright (C) Timo Kiviluoto
5 * Released under the GNU General
8 * See LICENSING which should be included
9 * along with this file for more details
16 #include <exception> // for std::bad_alloc
19 /*#include "ivancommon.h"*/
22 void *operator new (std::size_t size
) throw (std::bad_alloc
) {
23 if (size
> 0x1fffffff) {
24 //throw std::bad_alloc(); // ANSI/ISO compliant behavior
25 fprintf(stderr
, "`new`: size > 0x1fffffff! (%u)\n", size
);
28 void *p
= calloc(1, size
+64);
30 fprintf(stderr
, "`new`: out of memory for size=%u!\n", size
);
32 //throw std::bad_alloc(); // ANSI/ISO compliant behavior
34 //fprintf(stderr, "GLOBAL NEW!\n");
39 void operator delete (void *p
) throw () {
41 //fprintf(stderr, "GLOBAL DELETE!\n");