X Tutup
The Wayback Machine - https://web.archive.org/web/20220423224744/https://github.com/nodejs/node/pull/37443
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

Copy link
Member

@RaisinTen RaisinTen commented Feb 19, 2021

Fixes: #37442

@nodejs-github-bot nodejs-github-bot added the tools label Feb 19, 2021
@jasnell jasnell requested a review from joyeecheung Feb 19, 2021
Copy link
Member

@jasnell jasnell left a comment

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 Feb 20, 2021
@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 and removed tools labels Feb 20, 2021
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Feb 20, 2021

@RaisinTen RaisinTen added the c++ label Feb 20, 2021
Copy link
Member

@joyeecheung joyeecheung left a comment

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
Member Author

@RaisinTen RaisinTen commented Feb 21, 2021

@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

@joyeecheung joyeecheung commented Feb 21, 2021

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

@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Feb 21, 2021

@RaisinTen
Copy link
Member Author

@RaisinTen RaisinTen commented Feb 21, 2021

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

@RaisinTen RaisinTen added the author ready label Feb 21, 2021
@targos targos mentioned this pull request Feb 23, 2021
gengjiawen pushed a commit that referenced this issue Feb 23, 2021
Fixes: #37442

PR-URL: #37443
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@gengjiawen
Copy link
Member

@gengjiawen gengjiawen commented Feb 23, 2021

Landed in 954d911

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

PR-URL: #37443
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@targos targos added the backport-blocked-v14.x label May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready backport-blocked-v14.x c++ lib / src
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
X Tutup