mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
windows: Configure stack size for executables (fixes issue #3250)
Change the default stack size to 8 MiB for 64-bit and 0.5 MiB for 32-bit. CEF's main thread needs at least a 1.5 MiB stack size in order to avoid stack overflow crashes. However, if this is set in the PE file then other threads get this size as well, leading to address-space exhaustion in 32-bit CEF. A new CefRunWinMainWithPreferredStackSize function uses fibers to switch the main thread to a 4 MiB stack (roughly the same effective size as the 64-bit build's 8 MiB stack) before running any other code. This change additionally moves the existing Windows-only functions CefSetOSModalLoop and CefEnableHighDPISupport from cef_app.h to cef_win.h.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=bb6f61b0d69253de7bcc5506fd04562e46fa797c$
|
||||
// $hash=b5dc1bb07ea5cbf057bf40491fdcdddeb58dfa57$
|
||||
//
|
||||
|
||||
#include <dlfcn.h>
|
||||
@@ -95,8 +95,6 @@ struct libcef_pointers {
|
||||
decltype(&cef_do_message_loop_work) cef_do_message_loop_work;
|
||||
decltype(&cef_run_message_loop) cef_run_message_loop;
|
||||
decltype(&cef_quit_message_loop) cef_quit_message_loop;
|
||||
decltype(&cef_set_osmodal_loop) cef_set_osmodal_loop;
|
||||
decltype(&cef_enable_highdpi_support) cef_enable_highdpi_support;
|
||||
decltype(&cef_crash_reporting_enabled) cef_crash_reporting_enabled;
|
||||
decltype(&cef_set_crash_key_value) cef_set_crash_key_value;
|
||||
decltype(&cef_create_directory) cef_create_directory;
|
||||
@@ -336,8 +334,6 @@ int libcef_init_pointers(const char* path) {
|
||||
INIT_ENTRY(cef_do_message_loop_work);
|
||||
INIT_ENTRY(cef_run_message_loop);
|
||||
INIT_ENTRY(cef_quit_message_loop);
|
||||
INIT_ENTRY(cef_set_osmodal_loop);
|
||||
INIT_ENTRY(cef_enable_highdpi_support);
|
||||
INIT_ENTRY(cef_crash_reporting_enabled);
|
||||
INIT_ENTRY(cef_set_crash_key_value);
|
||||
INIT_ENTRY(cef_create_directory);
|
||||
@@ -599,14 +595,6 @@ NO_SANITIZE("cfi-icall") void cef_quit_message_loop() {
|
||||
g_libcef_pointers.cef_quit_message_loop();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") void cef_set_osmodal_loop(int osModalLoop) {
|
||||
g_libcef_pointers.cef_set_osmodal_loop(osModalLoop);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") void cef_enable_highdpi_support() {
|
||||
g_libcef_pointers.cef_enable_highdpi_support();
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall") int cef_crash_reporting_enabled() {
|
||||
return g_libcef_pointers.cef_crash_reporting_enabled();
|
||||
}
|
||||
|
Reference in New Issue
Block a user