-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Release pointers when we run out of memory in pewriter #50243
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
else | ||
{ | ||
delete[] TokInSymbolTable; | ||
return E_OUTOFMEMORY; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have also allocated reloc
and strtab
. Should we delete and set them to null too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this method and other stuff related to fixups in this directory reachable code?
It all looks related to EMIT_FIXUPS
that is never defined. It would be better to delete it all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this method and other stuff related to fixups in this directory reachable code?
This memory leak was flagged by a static analyzer. I am not sure it can tell if the code is reachable or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please try to delete this method, all code under EMIT_FIXUPS
ifdefs, and see whether it will compile fine (maybe with a few other unrechable pieces deleted)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried removing #ifdef EMIT_FIXUPS
(and the code they guard) completely, but this CeeFileGenWriter::fixup
fails to build looking for this (now undefined) method:
IfFailRet(getPEWriter().fixup(pMapper)); |
That call is not guarded by an #ifdef EMIT_FIXUPS
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, it was a bit less straightforward than I hoped. I have submitted #50259
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I am going to close this issue in favour of #50259 then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a few of the places you have touched will be still around even after my PR is merged. We can keep this one open, and then you can just resolve the conflict.
Should I try and use smart pointers here instead of these manually managed pointers that we sometimes forget to clean up? |
Yes, we preffer to use the smart pointers. |
@omajid Could you please resolve the conflict? |
Hi @omajid - Let us know if you'd like help resolving the conflicts on this PR so we can get it merged. Thanks! |
I'm going to mark this as a draft until the conflicts are resolved. @omajid, let us know if you'd like some help getting them resolved. Thanks! |
Draft Pull Request was automatically closed for inactivity. Please let us know if you'd like to reopen it. |
No description provided.