* moved libunix to lib/libc or lib/curses
[lightOS.git] / libsupc++ / memory.cpp
blob34b7e3a97f5ce74226631bac5d675f794405ab17
1 /*
2 lightOS supc++
3 Copyright (C) 2006-2008 Jörg Pfähler
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 #include <new>
20 #include <cstdlib>
21 using namespace std;
23 void *operator new (unsigned long size) throw()
25 return malloc(size);
28 void *operator new[] (unsigned long size) throw()
30 return malloc(size);
33 void *operator new (unsigned long size, void* memory) throw()
35 return memory;
38 void *operator new[] (unsigned long size, void* memory) throw()
40 return memory;
43 void operator delete (void * p)
45 free(p);
48 void operator delete[] (void * p)
50 free(p);
53 void operator delete (void *p, void *q)
57 void operator delete[] (void *p, void *q)