[Github-comments] [geany] plugins: pass GModule * to geany_load_module() (#719)

Thomas Martitz notifications at xxxxx
Sat Oct 31 19:48:50 UTC 2015


Am 31.10.2015 um 20:23 schrieb Colomban Wendling:
>
> Makes some sense, although it would be technically possible to simply 
> set |subplugin->priv->proxy_data = module| in |plugin_load_gmodule()| 
> before calling |geany_load_module()|.
>

Yea, I considered this as well. But I didn't like it as much (seems more 
like a hack to me) and earlier versions of new_hooks already had the 
parameter.


> If we go the additional arg way like this (which seem mostly OK to me, 
> see below), we need to document |plugin_module_make_resident()| 
> doesn't work with new-style API in |load()|, and probably deprecate 
> it. Advertizing both functions depending on the call site seems overly 
> odd to me.
>

It is documented, since the documentation for |geany_load_module() has a 
whitelist of API function that are allowed. I don't have a problem with 
deprecating ||plugin_module_make_resident() and I would rather not 
extend the whitelist without good reason. To me it's useless because 
it's a plain wrapper around a glib function. However, it's needed for 
legacy plugins which do not know about their GModule*.|

> However, most plugins probably only need to make the module resident 
> after |init()| -- as |load()| will often not create |GType|s; and if a 
> lot of plugins end up being resident when loaded (and all installed 
> plugins gets "loaded"), it might have a largish and unwanted memory 
> impact.
>

Yes, it would be better to do it in init() for best efficiency but IMO 
we should allow for doing it in |geany_load_module() too, might be 
necessary and/or more convenient for some plugins.

The difference between is normally not a problem, because it only kicks 
in after opening the PM dialog (where |||geany_load_module() is called 
for every plugin)|. For normal sessions ||geany_load_module() is only 
called for active ones on startup.
|


---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/719#issuecomment-152766371
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20151031/4b4e937f/attachment.html>


More information about the Github-comments mailing list