Skip to content
  • Allison Karlitskaya's avatar
    GVariant: fix normal-form checking for tuples · 998c6e65
    Allison Karlitskaya authored
    GVariant has the concept of fixed-sized types (ie: types for which all
    values of the type will have the same size).  Examples are booleans,
    integers, doubles, etc.  Tuples containing only these types are also
    fixed size.
    
    When GVariant is trying to deal with a fixed-sized value for which it
    doesn't have a sufficient backing store (eg: the case where a
    fixed-sized value was created with g_variant_new_data() with an
    incorrect number of bytes) it denotes this by setting the size of the
    value to the correct fixed size but using a NULL data pointer.
    
    This is well-documented in several code comments and also in the public
    API documentation for g_variant_get_data() which describes the situation
    number which NULL could be returned.
    
    The decision to deal with this case in this way was changed at the last
    minute around the time that GVariant was merged -- originally we had an
    elaborate setup involving allocating an internal buffer of sufficient
    size to be shared between...
    998c6e65