Re[2]: [Gc] Exporting GC_set_mark_bit and GC_clear_mark_bit

Ivan Maidanski ivmai at mail.ru
Sat Jan 7 12:23:07 PST 2012


Hi Petter,

07 01 2012, 18:35 Petter Urkedal <urkedal at nbi.dk>:
> On 2012-01-07, Ivan Maidanski wrote:
> > Hi Petter and Hans,
> >
> > Hans -
> > What do you think?
> >
> > Petter -
> > declspec for func definition should match func declaration i.e. if should add GC_API_PRIV for definitions.

Here, I was wrong - please discard the above statement.

> > But: by current design, GC_API_PRIV is used for functions that should be private but used by some tests, so I think it's better, if it would be considered to make these functions public, to move the to some public header (e.g., gc_mark.h) and use GC_API declspec and GC_CALL calling conv modifier.
> 
> I see, I interpreted it as "public use at your own risk".  Moving it to
> gc_mark.h sounds good.  It would be nice to stop including private
> headers.  I can prepare a new patch, but:
> 
>   - Do we want to move "typedef int GC_bool" to "gc.h"?  Maybe also add
>     GC_TRUE and GC_FALSE there (but leave TRUE and FALSE in gc_priv.h)?
>     Or do we change the return type of GC_is_marked to "int"?

I suggest no new typedefs and true/false.
Please replace:
GC_bool -> int
ptr_t -> void*

> 
>   - I'll add a comment that the client must hold the allocation lock.

Of course. (but no need to hurry, the comments may go in a separate commit after we agree about the API changes).

Regards.

>     Maybe GC_is_marked is safe enough to call without, but I don't think
>     the result is very useful without locking.
> 
> >
> > Regards
> >
> > 07 01 2012, 15:37 Petter Urkedal <urkedal at nbi.dk>:
> > > May I ask that the GC_set_mark_bit and GC_clear_mark_bit are exported?
> > > I use them as part of the code to resurrect objects in weak hash-tables.
> > > Imitating GC_is_marked I think this should do:
> > > https://github.com/paurkedal/bdwgc/commit/20652be420b7c38fab92ac2601b4210386df4a7e
> > >
> > > Cheers,
> > > Petter
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
> 



More information about the Gc mailing list