Re: Introspection binary format comments



On Sun, 2005-02-27 at 19:43 -0500, muppet wrote:
>On Feb 27, 2005, at 7:26 PM, Gustavo J. A. M. Carneiro wrote:
>
>> 	2. the "memory" option: when a library is loaded, we create a special
>> module object, derived from PyModule_Type, which contains an attribute
>> getter (tp_getattro slot) that looks up, in runtime, types.  Hence the
>> need for the hash table here.  So types aren't registered at module
>> import, they are created on demand, as they're requested from the
>> module.  A similar approach could be taken for loading methods on 
>> demand
>> for each object.
>
>I'm thinking of a hybrid option for gtk2-perl --- at load time, find 
>all the object types and register them as perl packages, but stop 
>there.  Then, use perl's AUTOLOAD magic to support demand-binding and 
>caching of methods as they are called by the application.  Still a 
>load-time hit, but there are far more methods in the API than types.  
>We'd have a hook in this process to create the hash table for ourselves 
>if it didn't already exist.

  Sounds like a good idea, especially if you can avoid calling the
gtk_xxxx_get_type() functions during startup.

  Regards.

-- 
Gustavo J. A. M. Carneiro
<gjc inescporto pt> <gustavo users sourceforge net>
The universe is always one step beyond logic.

Attachment: smime.p7s
Description: S/MIME cryptographic signature



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