Re: GProperty status



hi;

On 12 November 2012 20:16, David Nečas <yeti physics muni cz> wrote:
> On Mon, Nov 12, 2012 at 07:23:50PM +0000, Emmanuele Bassi wrote:
>> by using a bunch of shortcuts, GProperty avoids using GValue *a lot*;
>> boxing and unboxing of values is done using C pointers, instead of
>> touching GValue and the system allocator — and using correct copy
>> semantics (the default ones), it's possible to avoid memory allocation
>> completely. removing GValue boxing and unboxing gives us a pretty nice
>> win, like it did for GSignal marshalling.
>
> Hm, since things have got that far, would it also be possible to stop
> emitting redundant "notify" if nothing changes?

it's already implemented that way.

the implicit setter (i.e. the one that uses the direct field access
through the struct offset) will check the value for equality and bail
out in case the new value matches the old (as much as you can achieve
equality between floating point values). the explicit setter, which is
the function that you may pass when creating a new Property, has the
ability to return a boolean value - with TRUE meaning "I updated the
value" and FALSE meaning "I didn't update the value". GProperty will
emit a notification depending on that boolean return value.

ciao,
 Emmanuele.

--
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi/


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