Skip to content

Commit ea32e78

Browse files
Update addon.cpp
1 parent 821317e commit ea32e78

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/addon.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ using namespace v8;
3939

4040
#include "Multipart.h"
4141

42+
#include "v8-fast-api-calls.h" // go with nodejs 20 for now
43+
44+
uint32_t FastByteLengthUtf8(Local<Value> receiver, const v8::FastOneByteString& source) {
45+
return source.length;
46+
}
47+
48+
v8::CFunction fast_byte_length_utf8(v8::CFunction::Make(FastByteLengthUtf8));
49+
4250
void uWS_log(const FunctionCallbackInfo<Value> &args) {
4351

4452
Isolate *isolate = args.GetIsolate();

0 commit comments

Comments
 (0)