[Gc] getters and setters in misc.c

Boehm, Hans hans.boehm at hp.com
Thu Jun 11 17:53:54 PDT 2009


One of the concerns I have with putting out a more official GC release at this point is that I think the various GC_set and GC_get functions have gotten less consistent over time, and I'm not sure I want to commit to the current API.

Currently we have separate setters and getters in a few cases, but mostly we have set functions that return the old value, and can be used as getters by passing a special value.  Unfortunately, the special value can't be consistent, since we have to pick something that's not a valid argument to the set function.  This makes it unnecessarily hard to remember this part of the API.

I think I would rather see separate getters and setters everywhere, and avoid the special arguments completely.  This is probably an API change in a few cases already, but I think it's better to do this now than later.  We should probably add error checks for what used tobe the special values.

I'd love to see a patch that either did this, or cleaned up this part of the API in some other way.  I don't believe such a patch is currently pending.

Thanks in advance to anyone with the time to do this.

Hans


More information about the Gc mailing list