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

48198 node api external strings #48339

Closed
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
bd8045b
node-api: unify string creation
gabrielschulhof Jun 2, 2023
50a2109
node-api: add string creation benchmark
gabrielschulhof Jun 3, 2023
1364872
node-api: implement external strings
gabrielschulhof Jun 3, 2023
a9e24b9
add test
gabrielschulhof Jun 3, 2023
e1127d1
rename to node_api_*
gabrielschulhof Jun 4, 2023
953304c
put back build type
gabrielschulhof Jun 5, 2023
09f7cdf
make linter work
gabrielschulhof Jun 5, 2023
902cb33
rename as requested
gabrielschulhof Jun 6, 2023
754864e
use std::basic_string_view to calc length in case of NAPI_AUTO_LENGTH
gabrielschulhof Jun 6, 2023
95a9971
test for auto-length
gabrielschulhof Jun 7, 2023
b4f383b
format
gabrielschulhof Jun 7, 2023
05317ac
correct length
gabrielschulhof Jun 7, 2023
20ab0fb
doc
gabrielschulhof Jun 7, 2023
ca4c08c
use right length indicator
gabrielschulhof Jun 8, 2023
5de34d4
final adjustment
gabrielschulhof Jun 8, 2023
64f2498
Apply suggestions from code review
gabrielschulhof Jun 8, 2023
cb9d95a
Apply suggestions from code review
gabrielschulhof Jun 8, 2023
ed83494
remove utf8
gabrielschulhof Jun 9, 2023
e063901
handle the case where we copy the string
gabrielschulhof Jun 10, 2023
4ff5e53
implement the non-copying case
gabrielschulhof Jun 10, 2023
402c93e
Unify the two external cases
gabrielschulhof Jun 11, 2023
32a5600
factor out tracking
gabrielschulhof Jun 11, 2023
0b72009
document
gabrielschulhof Jun 11, 2023
50dfa5d
debug ctor dtor
gabrielschulhof Jun 11, 2023
3a96b04
typo
gabrielschulhof Jun 11, 2023
caccb8e
Apply suggestions from code review
gabrielschulhof Jun 11, 2023
5c11c81
Apply suggestions from code review
gabrielschulhof Jun 11, 2023
b651fca
use common distructor
gabrielschulhof Jun 12, 2023
668fd4d
format
gabrielschulhof Jun 12, 2023
c721439
Apply suggestions from code review
gabrielschulhof Jun 12, 2023
7f67a2f
md lint
gabrielschulhof Jun 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
  • Loading branch information
gabrielschulhof committed Jun 11, 2023
commit caccb8ecf85c4a78459e7d2dfa623e3700a6878b
4 changes: 2 additions & 2 deletions src/js_native_api_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class ExternalOneByteStringResource
size_t length() const override { return length_; }

private:
void Dispose() override { fprintf(stderr, "%p: one byte dtor\n", this); DoDispose(); }
void ~ExternalOneByteStringResource() { fprintf(stderr, "%p: one byte dtor\n", this); DoDispose(); }
gabrielschulhof marked this conversation as resolved.
Show resolved Hide resolved
const char* string_;
const size_t length_;
};
Expand All @@ -185,7 +185,7 @@ class ExternalStringResource : public v8::String::ExternalStringResource,
size_t length() const override { return length_; }

private:
void Dispose() override { fprintf(stderr, "%p: two byte dtor\n", this); DoDispose(); }
void ~ExternalStringResource() { fprintf(stderr, "%p: two byte dtor\n", this); DoDispose(); }
gabrielschulhof marked this conversation as resolved.
Show resolved Hide resolved
const uint16_t* string_;
const size_t length_;
};
Expand Down