Re: Q: are specific C marshallers obsolete these days?



On 10/30/2018 10:37:43 PM Tue, Peter Bloomfield wrote:
Hi Albrecht:

On 10/30/2018 04:14:28 PM Tue, Albrecht Dreß wrote:
Hi all,

while playing with the extension for LibBalsaServer's GET_PASSWORD signal to fix the issue of certificate 
password retrieval, I stumbled over the use of specific C marshallers for our custom signals.  IIRC, they 
have been used this way since many, many years in Balsa.

However, the GObject Reference manual, section “How to create and use signals” [1] states:

“The C signal marshaller should always be NULL, in which case the best marshaller for the given closure type 
will be chosen by GLib. This may be an internal marshaller specific to the closure type, or 
g_cclosure_marshal_generic, which implements generic conversion of arrays of parameters to C callback 
invocations. GLib used to require the user to write or generate a type-specific marshaller and pass that, but 
that has been deprecated in favour of automatic selection of marshallers.”

For me, this raises the question whether our custom marshallers are /really/ still needed, and for what 
reason?

Cheers,
Albrecht.


[1] <https://developer.gnome.org/gobject/stable/howto-signals.html>

Thanks for the link--I've never gone through those pages completely!

Yes, it seems that we can simplify Balsa code by passing the recommended NULL and letting g_signal_new() 
figure it out. Then we can drop the marshaller lists, and some clunky build system code for Balsa's custom 
marshallers. It would simplify maintenance and innovation, with most likely a completely negligible 
performance hit.

The custom marshaller lists and the corresponding build code have been removed from master. As recommended, 
we now pass NULL instead to g_signal_new(), including calls that previously used glib's g_cclosure_marshal_* 
functions.

Thanks again to Albrecht for spotting this opportunity!

Peter

Attachment: pgpnJK47Sb8wG.pgp
Description: PGP signature



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