mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backout changeset f70b74488807 (bug 833117) for gtest bustage on Linux
This commit is contained in:
parent
10e8f744a3
commit
bb576d901a
@ -4325,6 +4325,12 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
||||
mozilla::IOInterposerInit ioInterposerGuard;
|
||||
|
||||
#if defined(MOZ_WIDGET_GTK)
|
||||
#if defined(MOZ_MEMORY) || defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
// Disable the slice allocator, since jemalloc already uses similar layout
|
||||
// algorithms, and using a sub-allocator tends to increase fragmentation.
|
||||
// This must be done before g_thread_init() is called.
|
||||
g_slice_set_config(G_SLICE_CONFIG_ALWAYS_MALLOC, 1);
|
||||
#endif
|
||||
g_thread_init(nullptr);
|
||||
#endif
|
||||
|
||||
|
@ -54,6 +54,3 @@ USE_LIBS += [
|
||||
NO_EXPAND_LIBS = True
|
||||
|
||||
DIST_INSTALL = True
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
|
||||
CXXFLAGS += CONFIG['GLIB_CFLAGS']
|
||||
|
@ -426,48 +426,9 @@ XPCOMGlueEnablePreload()
|
||||
do_preload = true;
|
||||
}
|
||||
|
||||
#ifdef MOZ_WIDGET_GTK
|
||||
#include <glib.h>
|
||||
|
||||
class GSliceInit {
|
||||
#if defined(MOZ_MEMORY) || defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
public:
|
||||
GSliceInit() {
|
||||
mHadGSlice = bool(getenv("G_SLICE"));
|
||||
if (!mHadGSlice) {
|
||||
// Disable the slice allocator, since jemalloc already uses similar layout
|
||||
// algorithms, and using a sub-allocator tends to increase fragmentation.
|
||||
// This must be done before g_thread_init() is called.
|
||||
setenv("G_SLICE", "always-malloc", 1);
|
||||
}
|
||||
}
|
||||
|
||||
~GSliceInit() {
|
||||
if (mHadGSlice) {
|
||||
return;
|
||||
}
|
||||
if (sTop) {
|
||||
auto g_thread_init = (void (*)(void*)) GetSymbol(sTop->libHandle,
|
||||
"g_thread_init");
|
||||
auto g_type_init = (void (*)()) GetSymbol(sTop->libHandle, "g_type_init");
|
||||
g_thread_init(nullptr); // For GLib version < 2.32
|
||||
g_type_init(); // For 2.32 <= GLib version < 2.36
|
||||
}
|
||||
unsetenv("G_SLICE");
|
||||
}
|
||||
|
||||
private:
|
||||
bool mHadGSlice;
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
XPCOMGlueStartup(const char* aXPCOMFile)
|
||||
{
|
||||
#ifdef MOZ_WIDGET_GTK
|
||||
GSliceInit gSliceInit;
|
||||
#endif
|
||||
xpcomFunctions.version = XPCOM_GLUE_VERSION;
|
||||
xpcomFunctions.size = sizeof(XPCOMFunctions);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user