Win32: Drastically reduce stack usage at startup. NFC?
See: https://github.com/solvespace/solvespace/issues/92#issuecomment-567831112 The problem was first introduced here:pull/557/headdabd57847e
and later "fixed" here:f324477dd0
by setting the stack size to /STACK:33554432 Solvespace now starts up even with /STACK:554432 According to this: https://en.cppreference.com/w/cpp/language/value_initialization ``` "2) if T is a class type with a default constructor that is neither user-provided nor deleted (that is, it may be a class with an implicitly-defined or defaulted default constructor), the object is zero-initialized and then it is default-initialized if it has a non-trivial default constructor; " ``` So removing the `{}` should leave both the `System` and `TextWindow` class instances properly initialized.
parent
8ef3cacc33
commit
fcb2757d5d
|
@ -340,7 +340,7 @@ if(ENABLE_GUI)
|
|||
|
||||
if(MSVC)
|
||||
set_target_properties(solvespace PROPERTIES
|
||||
LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /INCREMENTAL:NO /OPT:REF /STACK:33554432")
|
||||
LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /INCREMENTAL:NO /OPT:REF")
|
||||
elseif(APPLE)
|
||||
set_target_properties(solvespace PROPERTIES
|
||||
OUTPUT_NAME SolveSpace)
|
||||
|
|
|
@ -810,8 +810,8 @@ public:
|
|||
// where it puts zero-initialized global data in the binary (~30M of zeroes)
|
||||
// in release builds.
|
||||
SolveSpaceUI()
|
||||
: pTW(new TextWindow({})), TW(*pTW),
|
||||
pSys(new System({})), sys(*pSys) {}
|
||||
: pTW(new TextWindow()), TW(*pTW),
|
||||
pSys(new System()), sys(*pSys) {}
|
||||
|
||||
~SolveSpaceUI() {
|
||||
delete pTW;
|
||||
|
|
Loading…
Reference in New Issue