Skip to content
  • Philip Withnall's avatar
    girepository: Make gi_repository_get_loaded_namespaces() deterministic · 03248e7b
    Philip Withnall authored
    
    
    As with the previous two commits, the results of calling
    `gi_repository_get_loaded_namespaces()` were previously
    non-deterministic due to being generated by iterating over a hash table,
    which has a non-deterministic iteration order.
    
    Fix that by using the new `ordered_typelibs` and `ordered_lazy_typelibs`
    arrays to provide deterministic ordering.
    
    At the same time, significantly reduce the number of allocations needed
    to build the return value — previously the results would be built as a
    linked list before being turned into an array. The linked list is now
    banished to history.
    
    Add some more unit tests to maximise test coverage of this method.
    
    Signed-off-by: default avatarPhilip Withnall <pwithnall@gnome.org>
    
    Fixes: #3303
    03248e7b