From 93002327db5e5f466de60dc3f8c876cf9a56e183 Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Wed, 19 Apr 2000 11:10:01 +0100 Subject: Imported version version 5.0alpha6. * acinclude.m4: Bump version to 5.0a6. * configure.in: Don't use alpha_mach_dep.s. * include/private/config.h, irix_threads.c gc_watcom.asm: Delete obsolete files. From-SVN: r33251 --- boehm-gc/gc_cpp.h | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'boehm-gc/gc_cpp.h') diff --git a/boehm-gc/gc_cpp.h b/boehm-gc/gc_cpp.h index ad7df5d71fa..36013e135b9 100644 --- a/boehm-gc/gc_cpp.h +++ b/boehm-gc/gc_cpp.h @@ -16,12 +16,11 @@ the code was modified is included with the above copyright notice. C++ Interface to the Boehm Collector John R. Ellis and Jesse Hull - Last modified on Mon Jul 24 15:43:42 PDT 1995 by ellis This interface provides access to the Boehm collector. It provides basic facilities similar to those described in "Safe, Efficient Garbage Collection for C++", by John R. Elis and David L. Detlefs -(ftp.parc.xerox.com:/pub/ellis/gc). +(ftp://ftp.parc.xerox.com/pub/ellis/gc). All heap-allocated objects are either "collectable" or "uncollectable". Programs must explicitly delete uncollectable @@ -38,7 +37,7 @@ Objects derived from class "gc" are collectable. For example: A* a = new A; // a is collectable. Collectable instances of non-class types can be allocated using the GC -placement: +(or UseGC) placement: typedef int A[ 10 ]; A* a = new (GC) A; @@ -124,6 +123,12 @@ invoked using the ANSI-conforming syntax t->~T(). If you're using cfront 3.0, you'll have to comment out the class gc_cleanup, which uses explicit invocation. +5. GC name conflicts: + +Many other systems seem to use the identifier "GC" as an abbreviation +for "Graphics Context". Since version 5.0, GC placement has been replaced +by UseGC. GC is an alias for UseGC, unless GC_NAME_CONFLICT is defined. + ****************************************************************************/ #include "gc.h" @@ -138,7 +143,11 @@ uses explicit invocation. # define OPERATOR_NEW_ARRAY #endif -enum GCPlacement {GC, NoGC, PointerFreeGC}; +enum GCPlacement {UseGC, +#ifndef GC_NAME_CONFLICT + GC=UseGC, +#endif + NoGC, PointerFreeGC}; class gc {public: inline void* operator new( size_t size ); @@ -211,7 +220,7 @@ inline void* gc::operator new( size_t size ) { return GC_MALLOC( size );} inline void* gc::operator new( size_t size, GCPlacement gcp ) { - if (gcp == GC) + if (gcp == UseGC) return GC_MALLOC( size ); else if (gcp == PointerFreeGC) return GC_MALLOC_ATOMIC( size ); @@ -261,7 +270,7 @@ inline void* operator new( { void* obj; - if (gcp == GC) { + if (gcp == UseGC) { obj = GC_MALLOC( size ); if (cleanup != 0) GC_REGISTER_FINALIZER_IGNORE_SELF( -- cgit v1.2.1