This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: question about if_marked construct
- From: Ian Lance Taylor <iant at google dot com>
- To: Tom de Vries <tjvries at xs4all dot nl>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 23 Jun 2010 07:49:57 -0700
- Subject: Re: question about if_marked construct
- References: <2AD11BFC-8AA4-4F5C-9B7A-E9AF370088D5@xs4all.nl>
Tom de Vries <tjvries@xs4all.nl> writes:
> static int prop(const_tree type)
> {
> return type == A;
> }
>
> static int type_hash_marked_p (const void *p) {
> const_tree const type = ((const struct type_hash *) p)->type;
> return ggc_marked_p (type) || prop (type);
> }
I would like to question your premise. The gcc garbage collector is
not some general purpose library. It's specifically for the use of
gcc. Why, in gcc, would you want to write such an if_marked property?
Is there some simpler and clearer way to express what you actually
want to have happen?
Ian