Fix GAPBIND14_TRY memory leak#1145
Conversation
|
This is a draft either until we have a valgrind CI job that can check if this actually fixes the memory leak, or until I can verify this locally on my PC. I have tested it on small, quick examples, but will feel more confident once valgrind has run the full standard test suite. |
james-d-mitchell
left a comment
There was a problem hiding this comment.
This looks good, I think we should do two things:
- Rebase this on #1104 so that we can see if this fixes the issues with valgrind or not;
- check that
__builtin_unreachableexists during configuration, and error out if does not.
I don't think this will resolve the issue we are currently facing in #1104. From what I can tell, there is a function that calls
In 6d664a4, I've done something similar to this. We don't error out if |
|
I'm happy with your solution looks great! |
|
@Joseph-Edwards can we merge this now? |
|
I'm currently running valgrind locally on the test files to make sure that this actually resolves those |
I'll investigate this further |
|
eek noting that that's the same number of bytes as before, no? |
Yeah I think so. I'm hoping it's related to the non-trivially-destructible stuff, and will be an easy fix |
|
Even better: it's the same number because seemingly I forgot to remake 🙃 I'm getting no leaks now. Happy to merge @james-d-mitchell? |
|
Merge? |
This PR fixes a memory leak in the
GAPBIND14_TRYmacro that was a result of the awkward interaction between C- and C++-style error handling. A summary of how we address this is included above the macro definition, and repeated below for clarity:This fix initially introduced a warning "control reaches end of non-void function", so we introduced the macro
GAPBIND14_TRY_WITH_RETURNto fix this.