Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: allocate collections in bump allocator #57

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

dsherret
Copy link
Member

@dsherret dsherret commented Feb 21, 2024

Fixes a memory leak where collections weren't being deallocated.

Many thanks to @irbull for investigating and tracking down this issue!

Co-authored-by: irbull irbull@users.noreply.github.com

});
writer.write("));").newLine();
writer.writeLine("let comments_ref = comments.as_ref().map(|t| unsafe { mem::transmute::<&CommentContainer, &'a CommentContainer<'a>>(t) });");
writer.writeLine(`let ast_view = ${getViewForFunctionName("Module")}(info_ref, tokens_ref, comments_ref, bump_ref);`);
Copy link
Member Author

Choose a reason for hiding this comment

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

This is pretty bad. I will do a followup to remove all these transmutes and clean this up.

@dsherret dsherret requested a review from bartlomieju February 21, 2024 19:57
@dsherret dsherret merged commit ad46058 into main Feb 21, 2024
3 checks passed
@dsherret dsherret deleted the fix_allocate_more_in_bump_allocator branch February 21, 2024 20:00
dsherret added a commit that referenced this pull request Feb 21, 2024
Fixes a memory leak where collections weren't being deallocated.

Co-authored-by: irbull irbull@users.noreply.github.com
dsherret added a commit that referenced this pull request Feb 21, 2024
Fixes a memory leak where collections weren't being deallocated.

Co-authored-by: irbull <irbull@users.noreply.github.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant