• Allison Karlitskaya's avatar
    gslice: stop using ctors · 5bfb64d5
    Allison Karlitskaya authored
    We can't initialise gslice from a ctor because g_slice_set_config() must
    be called before gslice initialisation.
    Instead, do the initialisation in a threadsafe way from the
    initialisation function for the thread private data.  This will only be
    called once per thread so the synchronisation doesn't pose a significant
    overhead here.
    Ensure that we try to grab the thread private data directly on entrance
    to g_slice_alloc() so that we force the initialisation to occur.
    Grabbing the private data is the common case anyway.
gslice.c 49.6 KB