summaryrefslogtreecommitdiff
path: root/boehm-gc/gc_cpp.cc
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>1999-04-07 08:01:30 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>1999-04-07 08:01:30 +0000
commit4eac4b716a6e15c801da6aa27c301a092871ab02 (patch)
treee6d8fcc8767be9361e18c552ee43ecfc3b4fdea8 /boehm-gc/gc_cpp.cc
parent48d678ffe51c7ad953681d9d1887eeac5d6ec2d7 (diff)
downloadgcc-4eac4b716a6e15c801da6aa27c301a092871ab02.tar.gz
Initial revision
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26246 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'boehm-gc/gc_cpp.cc')
-rw-r--r--boehm-gc/gc_cpp.cc46
1 files changed, 46 insertions, 0 deletions
diff --git a/boehm-gc/gc_cpp.cc b/boehm-gc/gc_cpp.cc
new file mode 100644
index 00000000000..a766a01a328
--- /dev/null
+++ b/boehm-gc/gc_cpp.cc
@@ -0,0 +1,46 @@
+/*************************************************************************
+Copyright (c) 1994 by Xerox Corporation. All rights reserved.
+
+THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
+OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
+
+ Last modified on Sat Nov 19 19:31:14 PST 1994 by ellis
+ on Sat Jun 8 15:10:00 PST 1994 by boehm
+
+Permission is hereby granted to copy this code for any purpose,
+provided the above notices are retained on all copies.
+
+This implementation module for gc_c++.h provides an implementation of
+the global operators "new" and "delete" that calls the Boehm
+allocator. All objects allocated by this implementation will be
+non-collectable but part of the root set of the collector.
+
+You should ensure (using implementation-dependent techniques) that the
+linker finds this module before the library that defines the default
+built-in "new" and "delete".
+
+Authors: John R. Ellis and Jesse Hull
+
+**************************************************************************/
+/* Boehm, December 20, 1994 7:26 pm PST */
+
+#include "gc_cpp.h"
+
+void* operator new( size_t size ) {
+ return GC_MALLOC_UNCOLLECTABLE( size );}
+
+void operator delete( void* obj ) {
+ GC_FREE( obj );}
+
+
+#ifdef OPERATOR_NEW_ARRAY
+
+void* operator new[]( size_t size ) {
+ return GC_MALLOC_UNCOLLECTABLE( size );}
+
+void operator delete[]( void* obj ) {
+ GC_FREE( obj );}
+
+#endif /* OPERATOR_NEW_ARRAY */
+
+