Skip to content
  • Barnabás Pőcze's avatar
    girepository: gi_object_info_find_signal(): Avoid repeated allocations · 7a528d0f
    Barnabás Pőcze authored
    Previously `gi_object_info_find_signal()` used `gi_object_info_get_signal()`
    to retrieve the *i*th signal and compare its name to the desired name.
    However, `gi_object_info_get_signal()` returns an allocated object.
    If the names were not matching, the allocated object was simply dropped,
    and this resulted in a lot of unnecessary allocations compared to the
    desired number of allocations, which is one.
    
    To avoid much of the overhead pertaining to the creation of these allocated
    `GISignalInfo` objects, introduce a new function that inspects the signal
    blobs directly and returns an allocated `GISignalInfo` object just for the
    matching signal. The function is largely a copy-and-paste of `gi_base_info_find_vfunc()`,
    which does the same thing, only for virtual functions.
    
    See gobject-introspection!504
    7a528d0f
Loading