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: remove usage of AllocatedBuffer from src/node_buffer.cc #39941

Conversation

RaisinTen
Copy link
Contributor

Since AllocatedBuffer is just a thin wrapper around v8::BackingStore, we
should prefer using v8::BackingStore directly.

Refs:

// TODO(addaleax): We may want to start phasing this out as it's only a
// thin wrapper around v8::BackingStore at this point

Signed-off-by: Darshan Sen [email protected]

@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Aug 30, 2021
@RaisinTen RaisinTen requested a review from addaleax August 30, 2021 08:09
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

src/node_buffer.cc Outdated Show resolved Hide resolved
Since AllocatedBuffer is just a thin wrapper around v8::BackingStore, we
should prefer using v8::BackingStore directly.

Refs: https://github.com/nodejs/node/blob/52abf271c563ddffdc93b444ea05e5347a7f2784/src/allocated_buffer.h#L30-L31

Signed-off-by: Darshan Sen <[email protected]>
@RaisinTen RaisinTen force-pushed the src/remove-usage-of-AllocatedBuffer-from-src/buffer.cc branch from 6ca23b2 to 2d93910 Compare August 30, 2021 09:04
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Aug 30, 2021

@RaisinTen RaisinTen added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 30, 2021
@VoltrexKeyva VoltrexKeyva removed the needs-ci PRs that need a full CI run. label Aug 30, 2021
@jasnell
Copy link
Member

jasnell commented Sep 3, 2021

Landed in 7cc96b2

jasnell pushed a commit that referenced this pull request Sep 3, 2021
Since AllocatedBuffer is just a thin wrapper around v8::BackingStore, we
should prefer using v8::BackingStore directly.

Refs: https://github.com/nodejs/node/blob/52abf271c563ddffdc93b444ea05e5347a7f2784/src/allocated_buffer.h#L30-L31

Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #39941
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@jasnell jasnell closed this Sep 3, 2021
@RaisinTen RaisinTen deleted the src/remove-usage-of-AllocatedBuffer-from-src/buffer.cc branch September 4, 2021 08:03
targos pushed a commit that referenced this pull request Sep 6, 2021
Since AllocatedBuffer is just a thin wrapper around v8::BackingStore, we
should prefer using v8::BackingStore directly.

Refs: https://github.com/nodejs/node/blob/52abf271c563ddffdc93b444ea05e5347a7f2784/src/allocated_buffer.h#L30-L31

Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #39941
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Sep 6, 2021
Since AllocatedBuffer is just a thin wrapper around v8::BackingStore, we
should prefer using v8::BackingStore directly.

Refs: https://github.com/nodejs/node/blob/52abf271c563ddffdc93b444ea05e5347a7f2784/src/allocated_buffer.h#L30-L31

Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #39941
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@targos targos mentioned this pull request Sep 6, 2021
RaisinTen added a commit to RaisinTen/node that referenced this pull request Mar 27, 2022
nodejs-github-bot pushed a commit that referenced this pull request Mar 31, 2022
Refs: #39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42492
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
nodejs-github-bot pushed a commit that referenced this pull request Mar 31, 2022
ZeroPadDiffieHellmanSecret() is in an anonymous namespace, so it has
static linkage already.

Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42492
Refs: #39941
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
nodejs-github-bot pushed a commit that referenced this pull request Mar 31, 2022
Buffer::Length() dereferences the passed Local, so calling it when the
underlying pointer is a nullptr would lead to a crash. This fixes that
by returning early instead.

Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42492
Refs: #39941
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
RaisinTen added a commit to RaisinTen/node that referenced this pull request Apr 3, 2022
juanarbol pushed a commit to juanarbol/node that referenced this pull request Apr 5, 2022
Refs: nodejs#39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: nodejs#42492
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
danielleadams pushed a commit that referenced this pull request Jun 27, 2022
ZeroPadDiffieHellmanSecret() is in an anonymous namespace, so it has
static linkage already.

Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42492
Refs: #39941
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
danielleadams pushed a commit that referenced this pull request Jun 27, 2022
Buffer::Length() dereferences the passed Local, so calling it when the
underlying pointer is a nullptr would lead to a crash. This fixes that
by returning early instead.

Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42492
Refs: #39941
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
danielleadams pushed a commit that referenced this pull request Jun 27, 2022
Refs: #39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42589
Reviewed-By: James M Snell <[email protected]>
danielleadams pushed a commit that referenced this pull request Jun 27, 2022
Refs: #39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42766
Reviewed-By: James M Snell <[email protected]>
danielleadams pushed a commit that referenced this pull request Jun 27, 2022
Refs: #39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42852
Reviewed-By: Anna Henningsen <[email protected]>
danielleadams pushed a commit that referenced this pull request Jun 27, 2022
Since all its uses are now gone, it's time to say goodbye to
AllocatedBuffer.

Refs: #39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #43008
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
targos pushed a commit that referenced this pull request Jul 11, 2022
Refs: #39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42492
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
targos pushed a commit that referenced this pull request Jul 11, 2022
ZeroPadDiffieHellmanSecret() is in an anonymous namespace, so it has
static linkage already.

Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42492
Refs: #39941
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
targos pushed a commit that referenced this pull request Jul 11, 2022
Buffer::Length() dereferences the passed Local, so calling it when the
underlying pointer is a nullptr would lead to a crash. This fixes that
by returning early instead.

Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42492
Refs: #39941
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
targos pushed a commit that referenced this pull request Jul 11, 2022
Refs: #39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42492
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
targos pushed a commit that referenced this pull request Jul 11, 2022
ZeroPadDiffieHellmanSecret() is in an anonymous namespace, so it has
static linkage already.

Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42492
Refs: #39941
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
targos pushed a commit that referenced this pull request Jul 11, 2022
Buffer::Length() dereferences the passed Local, so calling it when the
underlying pointer is a nullptr would lead to a crash. This fixes that
by returning early instead.

Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42492
Refs: #39941
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
targos pushed a commit that referenced this pull request Jul 11, 2022
Refs: #39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42589
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Jul 12, 2022
Refs: #39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42766
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Jul 12, 2022
Refs: #39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42852
Reviewed-By: Anna Henningsen <[email protected]>
targos pushed a commit that referenced this pull request Jul 12, 2022
Since all its uses are now gone, it's time to say goodbye to
AllocatedBuffer.

Refs: #39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #43008
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
targos pushed a commit that referenced this pull request Jul 31, 2022
Refs: #39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42492
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
targos pushed a commit that referenced this pull request Jul 31, 2022
ZeroPadDiffieHellmanSecret() is in an anonymous namespace, so it has
static linkage already.

Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42492
Refs: #39941
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
targos pushed a commit that referenced this pull request Jul 31, 2022
Buffer::Length() dereferences the passed Local, so calling it when the
underlying pointer is a nullptr would lead to a crash. This fixes that
by returning early instead.

Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42492
Refs: #39941
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
targos pushed a commit that referenced this pull request Jul 31, 2022
Refs: #39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42589
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Jul 31, 2022
Refs: #39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42766
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Jul 31, 2022
Refs: #39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42852
Reviewed-By: Anna Henningsen <[email protected]>
targos pushed a commit that referenced this pull request Jul 31, 2022
Since all its uses are now gone, it's time to say goodbye to
AllocatedBuffer.

Refs: #39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #43008
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
Refs: nodejs/node#39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: nodejs/node#42492
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
ZeroPadDiffieHellmanSecret() is in an anonymous namespace, so it has
static linkage already.

Signed-off-by: Darshan Sen <[email protected]>

PR-URL: nodejs/node#42492
Refs: nodejs/node#39941
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
Buffer::Length() dereferences the passed Local, so calling it when the
underlying pointer is a nullptr would lead to a crash. This fixes that
by returning early instead.

Signed-off-by: Darshan Sen <[email protected]>

PR-URL: nodejs/node#42492
Refs: nodejs/node#39941
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
Since all its uses are now gone, it's time to say goodbye to
AllocatedBuffer.

Refs: nodejs/node#39941
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: nodejs/node#43008
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
Reviewed-By: Anna Henningsen <[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. buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants