Win32: Drastically reduce stack usage at startup. NFC?

See:
https://github.com/solvespace/solvespace/issues/92#issuecomment-567831112

The problem was first introduced here:
dabd57847e

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.
pull/557/head
ruevs 2019-12-20 14:19:42 +02:00 committed by whitequark
parent 8ef3cacc33
commit fcb2757d5d
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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;