Skip to content

Commit

Permalink
Merge pull request #1016 from nodejs/main
Browse files Browse the repository at this point in the history
Create a new pull request by comparing changes across two branches
  • Loading branch information
GulajavaMinistudio authored Aug 15, 2024
2 parents 51fa7c0 + ccf05ef commit 073456c
Show file tree
Hide file tree
Showing 384 changed files with 6,781 additions and 3,622 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1529,8 +1529,8 @@ cpplint: lint-cpp
# Try with '--system' if it fails without; the system may have set '--user'
lint-py-build:
$(info Pip installing ruff on $(shell $(PYTHON) --version)...)
$(PYTHON) -m pip install --upgrade --target tools/pip/site-packages ruff==0.4.5 || \
$(PYTHON) -m pip install --upgrade --system --target tools/pip/site-packages ruff==0.4.5
$(PYTHON) -m pip install --upgrade --target tools/pip/site-packages ruff==0.5.2 || \
$(PYTHON) -m pip install --upgrade --system --target tools/pip/site-packages ruff==0.5.2

.PHONY: lint-py
ifneq ("","$(wildcard tools/pip/site-packages/ruff)")
Expand Down
20 changes: 20 additions & 0 deletions benchmark/buffers/buffer-write-string-short.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict';

const common = require('../common.js');
const bench = common.createBenchmark(main, {
encoding: [
'utf8', 'ascii', 'latin1',
],
len: [1, 8, 16, 32],
n: [1e6],
});

function main({ len, n, encoding }) {
const buf = Buffer.allocUnsafe(len);
const string = Buffer.from('a'.repeat(len)).toString();
bench.start();
for (let i = 0; i < n; ++i) {
buf.write(string, 0, encoding);
}
bench.end(n);
}
42 changes: 42 additions & 0 deletions benchmark/streams/compose.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
'use strict';
const common = require('../common.js');

const {
PassThrough,
Readable,
Writable,
compose,
} = require('node:stream');

const bench = common.createBenchmark(main, {
n: [1e3],
});

function main({ n }) {
const cachedPassThroughs = [];
const cachedReadables = [];
const cachedWritables = [];

for (let i = 0; i < n; i++) {
const numberOfPassThroughs = 100;
const passThroughs = [];

for (let i = 0; i < numberOfPassThroughs; i++) {
passThroughs.push(new PassThrough());
}

const readable = Readable.from(['hello', 'world']);
const writable = new Writable({ objectMode: true, write: (chunk, encoding, cb) => cb() });

cachedPassThroughs.push(passThroughs);
cachedReadables.push(readable);
cachedWritables.push(writable);
}

bench.start();
for (let i = 0; i < n; i++) {
const composed = compose(cachedReadables[i], ...cachedPassThroughs[i], cachedWritables[i]);
composed.end();
}
bench.end(n);
}
2 changes: 1 addition & 1 deletion benchmark/url/url-searchparams-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function getMethod(url, property) {

function main({ searchParams, property, n }) {
const url = new URL('https://nodejs.org');
if (searchParams === 'true') assert(url.searchParams);
if (searchParams === 'true') assert.ok(url.searchParams);

const method = getMethod(url, property);

Expand Down
11 changes: 7 additions & 4 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,12 @@
}],
[ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi"', {
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++20' ],
'cflags_cc': [
'-fno-rtti',
'-fno-exceptions',
'-fno-strict-aliasing',
'-std=gnu++20',
],
'defines': [ '__STDC_FORMAT_MACROS' ],
'ldflags': [ '-rdynamic' ],
'target_conditions': [
Expand Down Expand Up @@ -620,12 +625,10 @@
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
'GCC_STRICT_ALIASING': 'NO', # -fno-strict-aliasing
'PREBINDING': 'NO', # No -Wl,-prebind
'MACOSX_DEPLOYMENT_TARGET': '11.0', # -mmacosx-version-min=11.0
'USE_HEADERMAP': 'NO',
'OTHER_CFLAGS': [
'-fno-strict-aliasing',
],
'WARNING_CFLAGS': [
'-Wall',
'-Wendif-labels',
Expand Down
1 change: 0 additions & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,6 @@ def configure_v8(o, configs):
o['variables']['v8_enable_javascript_promise_hooks'] = 1
o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0
o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0
o['variables']['v8_no_strict_aliasing'] = 1 # Work around compiler bugs.
o['variables']['v8_optimized_debug'] = 0 if options.v8_non_optimized_debug else 1
o['variables']['dcheck_always_on'] = 1 if options.v8_with_dchecks else 0
o['variables']['v8_enable_object_print'] = 0 if options.v8_disable_object_print else 1
Expand Down
2 changes: 1 addition & 1 deletion deps/ncrypto/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ EnginePointer EnginePointer::getEngineByName(const std::string_view name,
}
}
}
return std::move(engine);
return engine;
}

bool EnginePointer::setAsDefault(uint32_t flags, CryptoErrorList* errors) {
Expand Down
Loading

0 comments on commit 073456c

Please sign in to comment.