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

allocate memory before calling blocksol #54

Merged
merged 3 commits into from Oct 24, 2022
Merged

allocate memory before calling blocksol #54

merged 3 commits into from Oct 24, 2022

Conversation

dholth
Copy link
Contributor

@dholth dholth commented Oct 14, 2022

Description

This is a shorter fix for #38, with apologies to the original submitter.

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Oct 14, 2022
@AndrewVallette
Copy link

Yes, this should solve the memory leak, but I'd like to see the allocation stay inside of blocksol. This ensures mem will be allocated if blocksol is ever called from a different location. (currently, it is not -- but I like to be safe :)

I would have opted for something closer to Kray-G's solution, except I would've assigned the dereferenced pointer to a local variable and used it in place of mem throughout the function. This would eliminate the need for so many dereferences.

@AndrewVallette
Copy link

The NULL check in blocksol combined with moving the allocation to the constructor looks good to me. 👍

@dholth dholth requested a review from jezdez October 24, 2022 16:39
@jezdez jezdez merged commit 537448e into main Oct 24, 2022
@jezdez jezdez deleted the memory-2 branch October 24, 2022 17:31
@jezdez jezdez mentioned this pull request Oct 24, 2022
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Oct 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed [bot] added once the contributor has signed the CLA locked [bot] locked due to inactivity
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants