Add USE_MALLOC define, to toggle the use of malloc() and free() instead of VLA#164
Open
davidebeatrici wants to merge 1 commit intoxiph:masterfrom
Open
Add USE_MALLOC define, to toggle the use of malloc() and free() instead of VLA#164davidebeatrici wants to merge 1 commit intoxiph:masterfrom
davidebeatrici wants to merge 1 commit intoxiph:masterfrom
Conversation
…ad of VLA This is required for MSVC.
Contributor
|
The USE_MALLOC name is a bit confusing, as the code of course use mallom even if USE_MALLOC is not defined... What about HAVE_VLA_SUPPORT or something like that instead? Is there some flag in modern C that can be used to detect compilers with such advanced feature available without manually setting a flag? |
Author
|
According to https://stackoverflow.com/a/49988810 we can use |
Author
|
Should I do that? |
Contributor
|
[Davide Beatrici]
Should I do that?
I have no idea who would make such decision, but for what it is worth, I
believe it is a better idea to automatically detect the need than to
depend on a manually set flag. So if it was up to me, I would do it. :)
--
Happy hacking
Petter Reinholdtsen
|
|
Here's my own take on a fix: #219 Relevant differences:
|
Member
|
Can you give the upgrade1 branch a try. The VLAs should all be replaced with fixes sizes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is required for MSVC.