]> gcc.gnu.org Git - gcc.git/blame - boehm-gc/gc_cpp.cc
Patch from Gunther Nikl.
[gcc.git] / boehm-gc / gc_cpp.cc
CommitLineData
73ffefd0
TT
1/*************************************************************************
2Copyright (c) 1994 by Xerox Corporation. All rights reserved.
3
4THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
5OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
6
7 Last modified on Sat Nov 19 19:31:14 PST 1994 by ellis
8 on Sat Jun 8 15:10:00 PST 1994 by boehm
9
10Permission is hereby granted to copy this code for any purpose,
11provided the above notices are retained on all copies.
12
13This implementation module for gc_c++.h provides an implementation of
14the global operators "new" and "delete" that calls the Boehm
15allocator. All objects allocated by this implementation will be
16non-collectable but part of the root set of the collector.
17
18You should ensure (using implementation-dependent techniques) that the
19linker finds this module before the library that defines the default
20built-in "new" and "delete".
21
22Authors: John R. Ellis and Jesse Hull
23
24**************************************************************************/
25/* Boehm, December 20, 1994 7:26 pm PST */
26
27#include "gc_cpp.h"
28
9110a741
BM
29#ifndef _MSC_VER
30/* In the Visual C++ case, we moved this into the header. */
73ffefd0
TT
31void* operator new( size_t size ) {
32 return GC_MALLOC_UNCOLLECTABLE( size );}
33
34void operator delete( void* obj ) {
35 GC_FREE( obj );}
36
73ffefd0
TT
37#ifdef OPERATOR_NEW_ARRAY
38
39void* operator new[]( size_t size ) {
40 return GC_MALLOC_UNCOLLECTABLE( size );}
41
42void operator delete[]( void* obj ) {
43 GC_FREE( obj );}
44
45#endif /* OPERATOR_NEW_ARRAY */
46
9110a741
BM
47#endif /* _MSC_VER */
48
73ffefd0 49
This page took 0.22866 seconds and 5 git commands to generate.