libsass
libsass copied to clipboard
Optimize big stack allocation (move to heap)
Stack allocation is free but heap isn't; how is this an optimization?
Stack allocation is free but heap isn't; how is this an optimization?
Out of stack issues? https://docs.microsoft.com/en-us/visualstudio/code-quality/c6262?view=vs-2019
@glebm care to create a PR with your suggested changes!?
Stack allocation is free but heap isn't; how is this an optimization?
Out of stack issues? https://docs.microsoft.com/en-us/visualstudio/code-quality/c6262?view=vs-2019
There is nothing wrong per se in having 32KB on stack. We could add an option to have /analyze:stacksize40000
or something.
Did this cause real-life crashes of libsass due to running out of stack? Even Alpine Linux lets us having more stack ... (but this code does not apply to Linux).
The memory payload is actually 64k, since the allocated array is of wchar
.
In the end this is just a precaution to satisfy MSVC static code analysis.
But I think it does make sense to allocate those 64k on the heap!?