Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#ifdef to remove Glux functionality completely? #120

Open
Kroc opened this issue Jul 17, 2021 · 5 comments
Open

#ifdef to remove Glux functionality completely? #120

Kroc opened this issue Jul 17, 2021 · 5 comments

Comments

@Kroc
Copy link
Contributor

Kroc commented Jul 17, 2021

I'm mainly thinking of retro systems and developing using PunyInform here. On EPOC32, for example, the binary size is ~500KB which for this platform is outrageously large and I'd like to cut that down if at all possible. The Frotz interpreter for the system can't play Glulx files anyway, so this functionality is surplus.

@erkyrath
Copy link
Contributor

The code is pretty finely divided -- there's lots of functions which have "if (glulx_mode)" clauses. (Over 160 at a quick count.) Making that a compile-time option would be very messy, and the number of people who would benefit is probably, um, you.

@rockwalrus
Copy link

You could try making glulx_mode a constant or a define with a value of zero and see if your compiler is smart enough to leave the code out entirely.

@erkyrath
Copy link
Contributor

I'm sure my compiler is that smart, but that doesn't help someone compiling with a C90 toolset on EPOC32!

@Kroc
Copy link
Contributor Author

Kroc commented Jul 18, 2021

EPOC32 code is compiled with VC6 on Win2000 and an ancient custom version of GCC, not on the device itself. Whilst old, they might be smart enough to remove the dead code.

@erkyrath
Copy link
Contributor

A quick experiment finds that changing glulx_mode from a variable to #define glulx_mode (0) reduces the binary size by about 18%. (clang-1205.0.22.9 on MacOS.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants