Re: atomic reference counting for gmain.c



Hi Owen,
 
> > the attached patch uses the new g_atomic_int_(inc|dec_and_test)
> > functions for atomic reference counting in gmain.c
> > GMainLoop and GMainContext are ported over. GSource can't be ported,
> > beacuse it uses guint for the reference count (like GMainLoop and
> > GMainContext) and is defined in a header file (unlike GMainLoop and
> > GMainContext) and we can't change structures in headers (that would give
> > us unstable ABI).
> 
> I don't understand this ... I thought that the plan was that
> g_atomic_int_<blah> would work on ints, precisely so that we
> could fix our existing refcounts which are typically guint.
> 
> We don't actually support any sizeof(int) != 32 platforms as well, 
> so changing guint => guint32 isn't actually ABI breakage,
> but....

If that is guaranteed, we can in fact do it.

Or we change the API of g_atomic_int from taking gint32 to taking
gint... That sounds better actually. Should better avoid unpleasant
surprises.

Bye,
Sebastian
-- 
Sebastian Wilhelmi                 |            här ovanför alla molnen
mailto:seppi seppi de              |     är himmlen så förunderligt blå
http://seppi.de                    |




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