Re: atomic reference counting for gmain.c

Hi Joel,

> > 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å                    |

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]