Skip to content

AST: leak memory rather than corrupt memory #68266

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

Closed
wants to merge 1 commit into from

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Sep 1, 2023

llvm::MallocAllocator uses operator new, not malloc. This memory may not be free'ed but must be deleted. However, this is also not guaranteed. Instead, we should have a global bump allocator or a global llvm::MallocAllocator that uses Allocate and Deallocate to manage this memory.

`llvm::MallocAllocator` uses `operator new`, not `malloc`.  This memory
may not be `free`'ed but must be `delete`d.  However, this is also not
guaranteed.  Instead, we should have a global bump allocator or a global
`llvm::MallocAllocator` that uses `Allocate` and `Deallocate` to manage
this memory.
@compnerd
Copy link
Member Author

compnerd commented Sep 1, 2023

CC: @DougGregor @rintaro @bnbarham

@compnerd compnerd mentioned this pull request Sep 1, 2023
9 tasks
@DougGregor
Copy link
Member

I have a nicer version of this in #68271

@DougGregor DougGregor closed this Sep 1, 2023
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