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

Use malloc and variably-modified types for SSMFE C interface tests and examples #171

Merged
merged 2 commits into from
Oct 30, 2023

Conversation

mjacobse
Copy link
Collaborator

On Windows, the tests ran out of stack space due to the many variable-length arrays on the stack (as found out in #162). So allocating on the heap with malloc instead. Fixes #156

To still be able to do all the matrix indexing, we use variably-modified types (also described in #162). That requires dereferencing to be added in many places and makes the syntax a bit unfamiliar, but it does avoid having to do the indexing manually. So to me this solution would be preferrable.

If the solution using manual indexing is preferred (mjacobse@b61dc5a), let me know and I can create a pull request with that instead.

On Windows, the tests ran out of stack space with the many
variable-length arrays on the stack, so replacing with malloc. To still
be able to do all the matrix indexing, we use variably-modified types.
That requires dereferencing to be added in many places and makes the
syntax a bit unfamiliar, but it does avoid having to do the indexing
manually.
Same as 92e1184 but for the examples instead of the tests.
@jfowkes jfowkes self-requested a review October 30, 2023 14:00
@jfowkes jfowkes added the bug label Oct 30, 2023
@jfowkes jfowkes added this to the Second Major Release milestone Oct 30, 2023
Copy link
Contributor

@jfowkes jfowkes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing thank you @mjacobse!

@jfowkes jfowkes merged commit 45055e8 into ralna:master Oct 30, 2023
16 checks passed
@mjacobse mjacobse deleted the ssmfe_c_tests_vmt branch October 30, 2023 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSMFE C interface segfaults on Windows
2 participants