[Gc] [PATCH] new_gc_alloc.h

Boehm, Hans hans_boehm@hp.com
Thu, 13 Nov 2003 14:50:02 -0800


Thanks.

I made the change in my source tree.

Is there a reason not to use gc_allocator.h instead?  It should be more portable,
and it's a bit more careful about this sort of stuff.

Hans

> -----Original Message-----
> From: gc-admin@napali.hpl.hp.com [mailto:gc-admin@napali.hpl.hp.com]On
> Behalf Of Andrew Begel
> Sent: Wednesday, November 12, 2003 2:20 PM
> To: 'gc@linux.hpl.hp.com'
> Subject: [Gc] [PATCH] new_gc_alloc.h
> 
> 
> new_gc_alloc.h uses _T for one of its template parameters. On 
> OSX, this 
> conflicts with a definition from /usr/include/ctype.h. Changing _T to 
> _Tp fixes the problem and I'm pretty sure shouldn't break any other 
> platforms.
> Attached is a patch for gc6.3alpha2.
> 
> Andy (apologies for line wrapping. Alternate instructions for the 
> patch: search for _T and replace with _Tp in include/new_gc_alloc.h).
> 
> 
> --- include/new_gc_alloc.h      Fri Jul 26 20:56:04 2002
> +++ ../gc6.3alpha2-andy/include/new_gc_alloc.h  Wed Nov 12 
> 13:01:50 2003
> @@ -393,12 +393,12 @@
> 
>   __STL_BEGIN_NAMESPACE
> 
> -template <class _T>
> -struct _Alloc_traits<_T, gc_alloc >
> +template <class _Tp>
> +struct _Alloc_traits<_Tp, gc_alloc >
>   {
>     static const bool _S_instanceless = true;
> -  typedef simple_alloc<_T, gc_alloc > _Alloc_type;
> -  typedef __allocator<_T, gc_alloc > allocator_type;
> +  typedef simple_alloc<_Tp, gc_alloc > _Alloc_type;
> +  typedef __allocator<_Tp, gc_alloc > allocator_type;
>   };
> 
>   inline bool operator==(const gc_alloc&,
> @@ -413,12 +413,12 @@
>     return false;
>   }
> 
> -template <class _T>
> -struct _Alloc_traits<_T, single_client_gc_alloc >
> +template <class _Tp>
> +struct _Alloc_traits<_Tp, single_client_gc_alloc >
>   {
>     static const bool _S_instanceless = true;
> -  typedef simple_alloc<_T, single_client_gc_alloc > _Alloc_type;
> -  typedef __allocator<_T, single_client_gc_alloc > allocator_type;
> +  typedef simple_alloc<_Tp, single_client_gc_alloc > _Alloc_type;
> +  typedef __allocator<_Tp, single_client_gc_alloc > allocator_type;
>   };
> 
>   inline bool operator==(const single_client_gc_alloc&,
> @@ -433,12 +433,12 @@
>     return false;
>   }
> 
> -template <class _T>
> -struct _Alloc_traits<_T, traceable_alloc >
> +template <class _Tp>
> +struct _Alloc_traits<_Tp, traceable_alloc >
>   {
>     static const bool _S_instanceless = true;
> -  typedef simple_alloc<_T, traceable_alloc > _Alloc_type;
> -  typedef __allocator<_T, traceable_alloc > allocator_type;
> +  typedef simple_alloc<_Tp, traceable_alloc > _Alloc_type;
> +  typedef __allocator<_Tp, traceable_alloc > allocator_type;
>   };
> 
>   inline bool operator==(const traceable_alloc&,
> @@ -453,12 +453,12 @@
>     return false;
>   }
> 
> -template <class _T>
> -struct _Alloc_traits<_T, single_client_traceable_alloc >
> +template <class _Tp>
> +struct _Alloc_traits<_Tp, single_client_traceable_alloc >
>   {
>     static const bool _S_instanceless = true;
> -  typedef simple_alloc<_T, single_client_traceable_alloc > 
> _Alloc_type;
> -  typedef __allocator<_T, single_client_traceable_alloc > 
> allocator_type;
> +  typedef simple_alloc<_Tp, single_client_traceable_alloc > 
> _Alloc_type;
> +  typedef __allocator<_Tp, single_client_traceable_alloc > 
> allocator_type;
>   };
> 
>   inline bool operator==(const single_client_traceable_alloc&,
> 
> _______________________________________________
> Gc mailing list
> Gc@linux.hpl.hp.com
> http://linux.hpl.hp.com/cgi-bin/mailman/listinfo/gc
>