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

Develop 1.0 codegen #56

Merged
merged 3 commits into from
Apr 4, 2024
Merged

Conversation

AmitSolomonPrinceton
Copy link
Collaborator

Added codegen functionality to osqp_mex.cpp and the related .m files. Some changes to c_source, memory.

…, update_codegen_defines. Added osqp_struct_codegen_defines.cpp and updated osqp_struct.h. Updated the relevant .m files (codegen.m still needs work). Minor refactoring to osqp_mex.cpp.
@@ -253,9 +253,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])

// delete the object and its data
if (!strcmp("delete", cmd)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm a bit confused about this. During the constructor ("new"), I dynamically create a new OSQPCodegenDefines object (see Line 159). Seeing how osqp_cleanup destroys osqpData->solver, I thought I would have to free osqpData->defines manually. However, when I did that, the program crashed because destroyObject tries to destroy the already freed memory. What I don't understand is why this doesn't happen with osqpData->solver, which is freed by osqp_cleanup.

@AmitSolomonPrinceton AmitSolomonPrinceton merged commit 6b9d2d0 into develop-1.0 Apr 4, 2024
16 checks passed
@AmitSolomonPrinceton AmitSolomonPrinceton deleted the Develop-1.0-codegen branch April 4, 2024 08:12
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

Successfully merging this pull request may close these issues.

1 participant