00001 /* 00002 * The contents of this file are subject to the Mozilla Public License 00003 * Version 1.0 (the "License"); you may not use this file except in 00004 * compliance with the License. You may obtain a copy of the License at 00005 * http://www.mozilla.org/MPL/ 00006 * 00007 * Software distributed under the License is distributed on an "AS IS" 00008 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 00009 * License for the specific language governing rights and limitations 00010 * under the License. 00011 * 00012 * The Original Code is legOS code, released October 17, 1999. 00013 * 00014 * The Initial Developer of the Original Code is Markus L. Noga. 00015 * Portions created by Markus L. Noga are Copyright (C) 1999 00016 * Markus L. Noga. All Rights Reserved. 00017 * 00018 * Contributor(s): Henner Zeller <H.Zeller@acm.org> 00019 */ 00020 00021 #include <stdlib.h> // for malloc(), free(), size_t def'ns 00022 00023 // if we are using 3.x compiler then define new style new/delete 00024 #if __GNUC__ >= 3 00025 00026 void* operator new(size_t size) { 00027 return malloc(size); 00028 } 00029 00030 00031 void* operator new[] (size_t size) { 00032 return malloc(size); 00033 } 00034 00035 00036 void operator delete (void *p) { 00037 free(p); 00038 } 00039 00040 00041 void operator delete[] (void *p) { 00042 free(p); 00043 } 00044 00045 #endif 00046