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

Fix a memory leak with trampoline creation #436

Merged
merged 2 commits into from
Sep 6, 2016
Merged

Fix a memory leak with trampoline creation #436

merged 2 commits into from
Sep 6, 2016

Conversation

yallop
Copy link
Owner

@yallop yallop commented Sep 6, 2016

Tie libffi closure lifetime to OCaml closure lifetime.

This still needs more care to avoid leaking trampolines built from
non-closures.
@yallop yallop merged commit 532ba64 into yallop:master Sep 6, 2016
@yallop yallop deleted the funptr-memory-leak branch September 6, 2016 10:52
let keep_alive w ~while_live:v = Gc.finalise (fun _ -> w; ()) v
let kept_alive_indefinitely = ref []
let keep_alive w ~while_live:v =
try Gc.finalise (fun _ -> w; ()) v
Copy link
Contributor

Choose a reason for hiding this comment

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

What about FLambda?

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks to @yallop for finding this bug.

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.

2 participants