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

Fixing all the memory leaks. #23

Open
nemerle opened this issue Jun 8, 2014 · 1 comment
Open

Fixing all the memory leaks. #23

nemerle opened this issue Jun 8, 2014 · 1 comment
Labels
type: bug (I) Something is not working as intended
Milestone

Comments

@nemerle
Copy link
Collaborator

nemerle commented Jun 8, 2014

Despite spending a good chunk of time on switching boomerang over to shared_ptrs, I couldn't solve the memory situation.

Got pretty close with shared_ptr/shared_from_this approach but after putting in 11+ hours into it, it barfed on this little gem:

    this->~PhiAssign(); // Explicitly destroy this, but keep the memory allocated.
    Assign *a = new (this) Assign(type_, lhs_, rhs_); // construct in-place. Note that 'a' == 'this'

So my current thinking is "Copy as much as possible from llvm's approach of single ownership" :

  • Prog owns Modules
  • Modules own Functions
  • Functions own BasicBlocks
  • BasicBlocks own Instructions
@ceeac ceeac added the type: bug (I) Something is not working as intended label Sep 7, 2018
@ceeac ceeac added this to the v0.5.0 milestone Sep 7, 2018
@ceeac
Copy link
Member

ceeac commented Sep 7, 2018

Most memory leaks have been fixed in develop now. However, there are still some memory leaks remaining that are difficult to fix - most notably in both parsers. I think it is best to solve these memory leaks after the parser rewrite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug (I) Something is not working as intended
Projects
None yet
Development

No branches or pull requests

2 participants