Re: atomic reference counting for gmain.c
- From: Sebastian Wilhelmi <seppi seppi de>
- To: Joel Becker <jlbec evilplan org>
- Cc: gtk-devel-list gnome org
- Subject: Re: atomic reference counting for gmain.c
- Date: Sun, 29 Feb 2004 11:24:40 +0100
> > Or we change the API of g_atomic_int from taking gint32 to taking
> > gint... That sounds better actually. Should better avoid unpleasant
> > surprises.
> Actually, the converse is true. Folks who use atomic counters
> can count pretty high. The Linux Kernel has this problem, where
> atomic_t is limited to 24 bits (thanks to sparc32), so there is a big
> fat comment about the counter limit.
> If you use gint32, everyone knows the max. If you use gint,
> folks will have to realize that their code that counts >MAX_INT32 will
> break on non-64bit platforms.
While that is true, using gint32 would prevent us from using the atomic
reference counting for ints in ABI-fixed structures, i.e. all structures
defined in public header files, which seems like a stronger case for
Sebastian Wilhelmi | här ovanför alla molnen
mailto:seppi seppi de | är himmlen så förunderligt blå
] [Thread Prev