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

src: fix alloc-dealloc-mismatch in node_snapshotable.h #37443

Conversation

RaisinTen
Copy link
Contributor

Fixes: #37442

@nodejs-github-bot nodejs-github-bot added the tools Issues and PRs related to the tools directory. label Feb 19, 2021
@jasnell jasnell requested a review from joyeecheung February 19, 2021 15:18
Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

LGTM but would like @joyeecheung to sign off also

@RaisinTen RaisinTen force-pushed the tools/fix-alloc-dealloc-mismatch-in-snapshot_builder.cc branch from 97f543c to 3789d14 Compare February 20, 2021 12:46
@RaisinTen RaisinTen changed the title tools: fix alloc-dealloc-mismatch in snapshot_builder.cc src: fix alloc-dealloc-mismatch in node_snapshotable.h Feb 20, 2021
@RaisinTen RaisinTen added lib / src Issues and PRs related to general changes in the lib or src directory. and removed tools Issues and PRs related to the tools directory. labels Feb 20, 2021
@nodejs-github-bot
Copy link
Collaborator

@RaisinTen RaisinTen added the c++ Issues and PRs that require attention from people who are familiar with C++. label Feb 20, 2021
Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

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

I can't see why there is a mismatch, but I guess whatever makes the linter happy...although this isn't a homogeneous array block, it's more like a block of memory whose layout is manually controlled by us since they are meant to be written as-is in blocks

@RaisinTen
Copy link
Contributor Author

@joyeecheung This was happening since the array was being allocated using new but was being freed using delete[]:


Do you think it would be more appropriate to convert the delete[] calls to delete calls instead of this fix?

@joyeecheung
Copy link
Member

@RaisinTen I see, we should use new[] instead since it's v8 that deletes the block with delete[].

@nodejs-github-bot
Copy link
Collaborator

@RaisinTen
Copy link
Contributor Author

Test failures don't seem to be related to this patch.

@RaisinTen RaisinTen added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 21, 2021
@targos targos mentioned this pull request Feb 23, 2021
gengjiawen pushed a commit that referenced this pull request Feb 23, 2021
Fixes: #37442

PR-URL: #37443
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
@gengjiawen
Copy link
Member

Landed in 954d911

@gengjiawen gengjiawen closed this Feb 23, 2021
@RaisinTen RaisinTen deleted the tools/fix-alloc-dealloc-mismatch-in-snapshot_builder.cc branch February 23, 2021 12:05
targos pushed a commit that referenced this pull request Feb 28, 2021
Fixes: #37442

PR-URL: #37443
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

alloc-dealloc-mismatch in test-asan builds
6 participants