From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- boehm-gc/gc_cpp.cc | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 boehm-gc/gc_cpp.cc (limited to 'boehm-gc/gc_cpp.cc') diff --git a/boehm-gc/gc_cpp.cc b/boehm-gc/gc_cpp.cc new file mode 100644 index 000000000..f8b803a8b --- /dev/null +++ b/boehm-gc/gc_cpp.cc @@ -0,0 +1,61 @@ +/************************************************************************* +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 GC_OPERATOR_NEW_ARRAY + +void* operator new[]( size_t size ) { + return GC_MALLOC_UNCOLLECTABLE( size );} + +void operator delete[]( void* obj ) { + GC_FREE( obj );} + +#endif /* GC_OPERATOR_NEW_ARRAY */ + +#ifdef _MSC_VER + +// This new operator is used by VC++ in case of Debug builds ! +void* operator new( size_t size, + int ,//nBlockUse, + const char * szFileName, + int nLine ) +{ +#ifndef GC_DEBUG + return GC_malloc_uncollectable( size ); +#else + return GC_debug_malloc_uncollectable(size, szFileName, nLine); +#endif +} + +#endif /* _MSC_VER */ + -- cgit v1.2.3