FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: use v8 Default Allocator in cctest fixture by danbev · Pull Request #17366 · nodejs/node · GitHub

/ node Public

test: use v8 Default Allocator in cctest fixture - #17366

Closed
danbev wants to merge 4 commits into
nodejs:masterfrom
danbev:test-use-default-allocator
Closed

test: use v8 Default Allocator in cctest fixture#17366
danbev wants to merge 4 commits into
nodejs:masterfrom
danbev:test-use-default-allocator

Conversation

danbev commented Nov 28, 2017

Copy link
Copy Markdown
Contributor

This commit updates the node_test_fixture to use
v8::ArrayBuffer::Allocator::NewDefaultAllocator() and removes the custom
allocator.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test

nodejs-github-bot added the test Issues and PRs related to the tests. label Nov 28, 2017

danbev commented Nov 28, 2017

Copy link
Copy Markdown
Contributor Author

This commit updates the node_test_fixture to use
v8::ArrayBuffer::Allocator::NewDefaultAllocator() and removes the custom
allocator.
mscdex added the c++ Issues and PRs that require attention from people who are familiar with C++. label Nov 28, 2017
Comment thread test/cctest/node_test_fixture.h Outdated
v8::V8::Initialize();
params_.array_buffer_allocator = &allocator_;
params_.array_buffer_allocator =
v8::ArrayBuffer::Allocator::NewDefaultAllocator();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I’m not sure it matters, but should we free the allocator instance at some point?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Good point, I'll take a look and see. Thanks

danbev commented Nov 29, 2017

Copy link
Copy Markdown
Contributor Author

Comment thread test/cctest/node_test_fixture.h Outdated

private:
node::NodePlatform* platform_ = nullptr;
v8::ArrayBuffer::Allocator* allocator_ = nullptr;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

How about using unique_ptr instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yeah, I should probably update all pointers in that file to use smart pointers. I'll update them. Thanks

bnoordhuis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Apropos nothing, the CreateParams instance doesn't need to be a data member, it can be stack-allocated in SetUp(). V8 doesn't use it after Isolate::New() returns.

danbev commented Nov 30, 2017

Copy link
Copy Markdown
Contributor Author

Apropos nothing, the CreateParams instance doesn't need to be a data member, it can be stack-allocated in SetUp(). V8 doesn't use it after Isolate::New() returns.

I noticed this too but was not sure if I should change it in the PR or not. But sounds like that would be alright so I'll update it. Thanks

bnoordhuis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM. The CreateParams change can be a separate commit.

addaleax commented Dec 1, 2017

Copy link
Copy Markdown
Member

CI: https://ci.nodejs.org/job/node-test-commit/14496/

addaleax added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Dec 1, 2017

danbev commented Dec 1, 2017

Copy link
Copy Markdown
Contributor Author

Landed in 6aee5fb and 7850112

danbev closed this Dec 1, 2017
danbev deleted the test-use-default-allocator branch December 1, 2017 06:59
danbev added a commit that referenced this pull request Dec 1, 2017
This commit updates the node_test_fixture to use
v8::ArrayBuffer::Allocator::NewDefaultAllocator() and removes the custom
allocator.

PR-URL: #17366
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
danbev added a commit that referenced this pull request Dec 1, 2017
PR-URL: #17366
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
addaleax removed the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Dec 1, 2017
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
This commit updates the node_test_fixture to use
v8::ArrayBuffer::Allocator::NewDefaultAllocator() and removes the custom
allocator.

PR-URL: #17366
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
PR-URL: #17366
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
This commit updates the node_test_fixture to use
v8::ArrayBuffer::Allocator::NewDefaultAllocator() and removes the custom
allocator.

PR-URL: #17366
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
PR-URL: #17366
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins mentioned this pull request Dec 12, 2017
gibfahn pushed a commit that referenced this pull request Dec 19, 2017
This commit updates the node_test_fixture to use
v8::ArrayBuffer::Allocator::NewDefaultAllocator() and removes the custom
allocator.

PR-URL: #17366
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
gibfahn pushed a commit that referenced this pull request Dec 19, 2017
PR-URL: #17366
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
gibfahn mentioned this pull request Dec 20, 2017
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
This commit updates the node_test_fixture to use
v8::ArrayBuffer::Allocator::NewDefaultAllocator() and removes the custom
allocator.

PR-URL: #17366
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
PR-URL: #17366
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
gibfahn mentioned this pull request Dec 20, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants


Back | FazBrowse Home | New Git URL