Skip to content

Commit

Permalink
Win32: Drastically reduce stack usage at startup. NFC?
Browse files Browse the repository at this point in the history
See:
#92 (comment)

The problem was first introduced here:
dabd578

and later "fixed" here:
f324477
by setting the stack size to /STACK:33554432

Solvespace now starts up even with /STACK:554432

The only question now is whether omitting the {} in TextWindow and System constructor calls in the initializer list of the SolveSpaceUI constructor has any adverse effect.
  • Loading branch information
ruevs committed Dec 23, 2019
1 parent 16c5fa6 commit 4188cdf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/solvespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -810,8 +810,8 @@ class SolveSpaceUI {
// 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;
Expand Down

0 comments on commit 4188cdf

Please sign in to comment.