Skip to content
Snippets Groups Projects
  • Nat Goodspeed's avatar
    5459f2ee
    Fix Linux UI issues introduced by moving llinitparam to llcommon. · 5459f2ee
    Nat Goodspeed authored
    In a number of places, the viewer uses a lookup based on std::type_info*. We
    used to use std::map<std::type_info*, whatever>. But on Linux,
    &typeid(SomeType) can produce different pointer values, depending on the
    dynamic load module in which the code is executed. Introduce
    LLTypeInfoLookup<T>, with an API that deliberately mimics
    std::map<std::type_info*, T>. LLTypeInfoLookup::find() first tries an
    efficient search for the specified std::type_info*. But if that fails, it
    scans the underlying container for a match on the std::type_info::name()
    string. If found, it caches the new std::type_info* to optimize subsequent
    lookups with the same pointer.
    Use LLTypeInfoLookup instead of std::map<std::type_info*, ...> in
    llinitparam.h and llregistry.h.
    Introduce LLSortedVector<KEY, VALUE>, a std::vector<std::pair<KEY, VALUE>>
    maintained in sorted order with binary-search lookup. It presents a subset of
    the std::map<KEY, VALUE> API.
    5459f2ee
    History
    Fix Linux UI issues introduced by moving llinitparam to llcommon.
    Nat Goodspeed authored
    In a number of places, the viewer uses a lookup based on std::type_info*. We
    used to use std::map<std::type_info*, whatever>. But on Linux,
    &typeid(SomeType) can produce different pointer values, depending on the
    dynamic load module in which the code is executed. Introduce
    LLTypeInfoLookup<T>, with an API that deliberately mimics
    std::map<std::type_info*, T>. LLTypeInfoLookup::find() first tries an
    efficient search for the specified std::type_info*. But if that fails, it
    scans the underlying container for a match on the std::type_info::name()
    string. If found, it caches the new std::type_info* to optimize subsequent
    lookups with the same pointer.
    Use LLTypeInfoLookup instead of std::map<std::type_info*, ...> in
    llinitparam.h and llregistry.h.
    Introduce LLSortedVector<KEY, VALUE>, a std::vector<std::pair<KEY, VALUE>>
    maintained in sorted order with binary-search lookup. It presents a subset of
    the std::map<KEY, VALUE> API.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.