Re: atomic reference counting for gmain.c
- From: Joel Becker <jlbec evilplan org>
- To: Sebastian Wilhelmi <seppi seppi de>
- Cc: Owen Taylor <otaylor redhat com>, gtk-devel-list gnome org
- Subject: Re: atomic reference counting for gmain.c
- Date: Fri, 27 Feb 2004 18:15:29 +0000
On Fri, Feb 27, 2004 at 06:18:43PM +0100, Sebastian Wilhelmi wrote:
> 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.
Joel
--
"What do you take me for, an idiot?"
- General Charles de Gaulle, when a journalist asked him
if he was happy.
http://www.jlbec.org/
jlbec evilplan org
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]