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

Don't pass entire file contents as template parameter #69

Closed
schveiguy opened this issue Oct 9, 2019 · 5 comments
Closed

Don't pass entire file contents as template parameter #69

schveiguy opened this issue Oct 9, 2019 · 5 comments

Comments

@schveiguy
Copy link
Contributor

This explodes all the symbols inside to huge amounts as the file contents become part of the symbol (and all nested symbols). Not sure how much this will reduce the resulting footprints, but definitely worth looking at. At least compiler errors and exception traces will look more reasonable.

@s-ludwig
Copy link
Member

I also noticed that this seems to have slipped in again, although I'm pretty sure I fixed it at some point by passing an alias to a static immutable global. Do you know off hand which template has that issue?

@schveiguy
Copy link
Contributor Author

schveiguy commented Oct 10, 2019

Ah, OK. I misread the fact that it is an alias and not the string itself. Are we sure that aliases to a static immutable string don't translate into the string itself? I know I have had cases when developing a new feature for diet-ng that I have seen stack traces or compiler errors (can't remember which) where the entire contents of the file are displayed as part of the symbol. But that could possibly be because I'm passing in the string directly to compileHTMLDietString? I don't actually know. I'll close for now, unless I can prove otherwise.

@s-ludwig
Copy link
Member

I'm also unsure where I saw it, but I also did see it (it could have just been an old diet-ng version, though). Unfortunately it doesn't seem to occur for normal errors, so I guess this has to rest until it shows up again.

@s-ludwig
Copy link
Member

Okay, just got an error message citing the whole source code. In fact it's not a template instantiation, but a CTFE call stack that lists all function arguments as stringified expressions. It can be fixed by using static immutable for the input file array instead of enum.

@schveiguy
Copy link
Contributor Author

Nice! Yeah, I forgot to come back to this, I saw it also, Seems to happen when you have a syntax error in your diet file that causes the diet parsing to fail.

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

2 participants