RE: The iterator interface



On Tue, 2006-08-08 at 11:29 +0300, Dirk-Jan Binnema nokia com wrote:

> >Now, who's going to write the patch? :). I can't. Mickey Mouse 
> >doesn't allow me. 
> 
> You mean the patch to make most iterators ops void, and the unref
> thingy? I can do that. Will be tonight though.

Also fix all existing code of course :-)

There's one exception, and that is the build-in iterator fot
TnyHeaderListModel. Adding unreffing and reffing there isn't needed as
all item-access is locked already anyway.

And adding the ref and unref would slowdown sorting. That one uses
'special' _nl functions anyway (so the normal _current implementation of
that iterator should indeed return with an extra ref, the _nl one
shouldn't).

ps. _nl stands for "no lock", because the locking happens at a higher
level (in the model implementation). Some are by the way implemented in
the model implementation and are marked as inline.

> There's one class of errors where the compiler
> might help, ie. the __attribute__((warn_unused_result)), and there's
> a macro for that in glib, G_GNUC_WARN_UNUSED_RESULT. Any problem
> with using that one?

No, feel free to use it.


-- 
Philip Van Hoof, software developer at x-tend 
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
work: vanhoof at x-tend dot be 
http://www.pvanhoof.be - http://www.x-tend.be




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