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

doc: modified docs to reflect how to invoke gc on Wrapping C++ objects #20269

Closed
wants to merge 76 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
b952907
doc: modified docs to reflect how to invoke gc on Wrapping C++ objects
isurusiri Apr 25, 2018
51491dd
test: remove crypto.DEFAULT_ENCODING usage
danbev Apr 23, 2018
293ff07
test: add checkMethods function for Certificate
danbev Apr 23, 2018
5e521a2
src: limit foreground tasks draining loop
ulan Apr 12, 2018
cac9923
doc: fix net.Socket link inconsistencies
Hackzzila Apr 25, 2018
90538fd
doc: update pull request template in guide
Hackzzila Apr 25, 2018
c378d61
test,n-api: re-write test_error in C
Apr 24, 2018
33666c6
n-api,test: make methods static
Apr 24, 2018
5aaee48
src: fix Systemtap node_gc_stop probe
wcohen Apr 19, 2018
23f345e
src: assign ERR_SCRIPT_EXECUTION_* codes in C++
joyeecheung Apr 19, 2018
29eb3cb
crypto: use kNoAuthTagLength in InitAuthenticated
tniessen Apr 23, 2018
79ea56f
crypto: add using directives for v8::Int32, Uint32
tniessen Apr 24, 2018
b30aeee
doc: add emitter.off() to events.md
Ajido Apr 25, 2018
683c531
doc: improve docs for Http2Session:frameError
ryzokuken Apr 23, 2018
2e43a78
crypto: simplify diffiehellman getFormat function
danbev Apr 24, 2018
1568ed8
crypto: add getIntOption function to reduce dupl
danbev Apr 24, 2018
8c8aa5f
crypto: add checkIsArrayBufferView
danbev Apr 24, 2018
71040a8
crypto: make pbkdf2 use checkIsArrayBufferView
danbev Apr 25, 2018
8847d45
test: fix flaky child-process-exec-kill-throws
santigimeno Apr 22, 2018
4d660b3
n-api,test: make method static
Apr 25, 2018
40a9fc1
n-api: update cli documentation
Apr 25, 2018
949a7b6
n-api,test: remove superfluous persistent
Apr 25, 2018
40b7351
inspector: Use default uv_listen backlog size
Apr 24, 2018
c87e9fd
http: added aborted property to request
ronag Apr 17, 2018
b0086a0
lib: introduce internal/validators
targos Apr 15, 2018
5b622b5
process: migrate methods to throw errors with code
targos Apr 12, 2018
cde47a2
test: added coverage for fs/promises API
mithunsasidharan Apr 23, 2018
d7f8fbe
test: removed assert.strictEqual message
kailashyogeshwar85 Apr 23, 2018
576fd81
src: create per-isolate strings after platform setup
ulan Apr 20, 2018
581c5e2
doc: fix unhandled to uncaught
BridgeAR Apr 25, 2018
c089518
doc: remove os.uptime() Windows note
cjihrig Apr 25, 2018
fcca475
src: remove SecureContext `_external` getter
addaleax Apr 23, 2018
2bd51c1
n-api: remove unused Test function
danbev Apr 26, 2018
7bf83b4
crypto: support authTagLength in GCM encryption
tniessen Apr 15, 2018
5f715c0
doc: add Slack community to support options
hackygolucky Jan 16, 2018
13fb8de
inspector: allow concurrent inspector sessions
Apr 24, 2018
61cc174
tools: show stdout/stderr for timed out tests
Trott Apr 24, 2018
e78a64d
doc: remove console.table() as inspector-dependent
Trott Apr 26, 2018
9058cf4
tls: specify options.name in validateKeyCert
danbev Apr 25, 2018
54bd796
doc: fix typo in console.md
dhritzkiv Apr 27, 2018
642a3a3
doc: remove superfluous URL require statement
MarkTiedemann Apr 27, 2018
01cbdcb
build: do not depend on `cp` in `PATH`
addaleax Apr 25, 2018
c2959c4
src: improve fatal exception
BridgeAR Apr 25, 2018
90e249c
http: refactor outgoing headers processing
apapirovski Apr 24, 2018
a63bb90
doc: improve parameters for Http2Session:goaway event
ryzokuken Apr 26, 2018
27ac6d9
tools: add log output to crashes
BridgeAR Apr 25, 2018
afbdd14
tools: simplify HTML generation
vsemozhetbyt Apr 25, 2018
32dd2be
doc: remove eu-strip from tarball
jvelezpo Apr 25, 2018
90291ba
tools: remove redundant RegExp flag
vsemozhetbyt Apr 25, 2018
f3b858d
doc: unify and dedupe returned values in timers.md
vsemozhetbyt Apr 25, 2018
7e0d507
console: fix console.table() display edge case
Trott Apr 26, 2018
f367090
util: fix isInsideNodeModules inside error
apapirovski Apr 24, 2018
f48db30
src: remove unnecessary copy operations in tracing
addaleax Apr 27, 2018
a0192f2
benchmark: add bench for zlib gzip + gunzip cycle
addaleax Apr 14, 2018
f92dce6
stream: only check options once in Duplex ctor
danbev Apr 27, 2018
6b23b18
fs: point isFd to isUint32
danbev Apr 26, 2018
8cd94b3
tls: fix getEphemeralKeyInfo to support X25519
shigeki Apr 25, 2018
4312032
http2: fix responses to long payload reqs
apapirovski Apr 16, 2018
fd59016
doc: add missing backticks in n-api.md
vsemozhetbyt Apr 28, 2018
0fea189
doc: remove redundant empty lines
vsemozhetbyt Apr 29, 2018
2fa61b8
timers: reschedule interval even if it threw
apapirovski Apr 11, 2018
4a79239
buffer: do not always use defaults
BridgeAR Apr 15, 2018
cc14207
child_process: fix leak when passing http sockets
santigimeno Apr 19, 2018
9e56d1d
http,https,tls: switch to WHATWG URL parser
Hackzzila Apr 25, 2018
686cfe2
assert: minor error message improvements
BridgeAR Apr 26, 2018
4f9929d
assert: make skipping indicator blue
BridgeAR Apr 26, 2018
ed601bc
doc: improve assert docs
BridgeAR Apr 26, 2018
4477299
doc: improve process event headers
BridgeAR Apr 26, 2018
bd44f4d
http2: fix ping callback
BridgeAR Apr 26, 2018
ad4dcbb
test: verify arguments length in common.expectsError
BridgeAR Apr 26, 2018
db1f708
test: fix a TODO and remove obsolete TODOs
BridgeAR Apr 26, 2018
6474b70
build: remove --xcode configure switch
bnoordhuis Apr 26, 2018
b7f6fcb
stream: fix error handling with async iteration
julien-f Apr 26, 2018
79e20b5
doc: remove parenthetical in onboarding-extras
Trott Apr 29, 2018
c71ee37
src: avoid `std::make_unique`
addaleax Apr 28, 2018
7c1ec87
doc: modified docs to reflect how to invoke gc on Wrapping C++ objects
isurusiri Apr 30, 2018
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,4 @@ deps/v8/src/Debug/
deps/v8/src/Release/
deps/v8/src/inspector/Debug/
deps/v8/src/inspector/Release/
deps/v8/third_party/eu-strip/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ tools/doc/node_modules/js-yaml/package.json:

gen-json = tools/doc/generate.js --format=json $< > $@
gen-html = tools/doc/generate.js --node-version=$(FULLVERSION) --format=html \
--template=doc/template.html --analytics=$(DOCS_ANALYTICS) $< > $@
--analytics=$(DOCS_ANALYTICS) $< > $@

out/doc/api/%.json: doc/api/%.md
$(call available-node, $(gen-json))
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ search these unofficial resources:
* [Questions tagged 'node.js' on StackOverflow][]
* [#node.js channel on chat.freenode.net][]. See <http://nodeirc.info/> for more
information.
* [Node.js Slack Community](https://node-js.slack.com/): Visit
[nodeslackers.com](http://www.nodeslackers.com/) to register.

GitHub issues are meant for tracking enhancements and bugs, not general support.

Expand Down
36 changes: 36 additions & 0 deletions benchmark/http/headers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
'use strict';

const common = require('../common.js');
const http = require('http');

const bench = common.createBenchmark(main, {
duplicates: [1, 100],
n: [10, 1000],
});

function main({ duplicates, n }) {
const headers = {
'Connection': 'keep-alive',
'Transfer-Encoding': 'chunked',
};

for (var i = 0; i < n / duplicates; i++) {
headers[`foo${i}`] = [];
for (var j = 0; j < duplicates; j++) {
headers[`foo${i}`].push(`some header value ${i}`);
}
}

const server = http.createServer(function(req, res) {
res.writeHead(200, headers);
res.end();
});
server.listen(common.PORT, function() {
bench.http({
path: '/',
connections: 10
}, function() {
server.close();
});
});
}
39 changes: 39 additions & 0 deletions benchmark/zlib/pipe.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
'use strict';
const common = require('../common.js');
const fs = require('fs');
const zlib = require('zlib');

const bench = common.createBenchmark(main, {
inputLen: [1024],
duration: [5],
type: ['string', 'buffer']
});

function main({ inputLen, duration, type }) {
const buffer = Buffer.alloc(inputLen, fs.readFileSync(__filename));
const chunk = type === 'buffer' ? buffer : buffer.toString('utf8');

const input = zlib.createGzip();
const output = zlib.createGunzip();

let readFromOutput = 0;
input.pipe(output);
if (type === 'string')
output.setEncoding('utf8');
output.on('data', (chunk) => readFromOutput += chunk.length);

function write() {
input.write(chunk, write);
}

bench.start();
write();

setTimeout(() => {
// Give result in GBit/s, like the net benchmarks do
bench.end(readFromOutput * 8 / (1024 ** 3));

// Cut off writing the easy way.
input.write = () => {};
}, duration * 1000);
}
13 changes: 1 addition & 12 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,6 @@ parser.add_option('--without-node-options',
dest='without_node_options',
help='build without NODE_OPTIONS support')

parser.add_option('--xcode',
action='store_true',
dest='use_xcode',
help='generate build files for use with xcode')

parser.add_option('--ninja',
action='store_true',
dest='use_ninja',
Expand Down Expand Up @@ -1005,9 +1000,6 @@ def configure_node(o):

o['variables']['asan'] = int(options.enable_asan or 0)

if options.use_xcode and options.use_ninja:
raise Exception('--xcode and --ninja cannot be used together.')

if options.coverage:
o['variables']['coverage'] = 'true'
else:
Expand Down Expand Up @@ -1530,7 +1522,6 @@ write('config.gypi', do_not_edit +

config = {
'BUILDTYPE': 'Debug' if options.debug else 'Release',
'USE_XCODE': str(int(options.use_xcode or 0)),
'PYTHON': sys.executable,
'NODE_TARGET_TYPE': variables['node_target_type'],
}
Expand All @@ -1549,9 +1540,7 @@ write('config.mk', do_not_edit + config)

gyp_args = ['--no-parallel']

if options.use_xcode:
gyp_args += ['-f', 'xcode']
elif options.use_ninja:
if options.use_ninja:
gyp_args += ['-f', 'ninja']
elif flavor == 'win' and sys.platform != 'msys':
gyp_args += ['-f', 'msvs', '-G', 'msvs_version=auto']
Expand Down
24 changes: 0 additions & 24 deletions deps/v8/third_party/eu-strip/README.v8

This file was deleted.

Binary file removed deps/v8/third_party/eu-strip/bin/eu-strip
Binary file not shown.
13 changes: 7 additions & 6 deletions doc/api/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ Addon developers are recommended to use to keep compatibility between past and
future releases of V8 and Node.js. See the `nan` [examples][] for an
illustration of how it can be used.


## N-API

> Stability: 1 - Experimental
Expand Down Expand Up @@ -307,7 +306,6 @@ built using `node-gyp`:
$ node-gyp configure build
```


### Function arguments

Addons will typically expose objects and functions that can be accessed from
Expand Down Expand Up @@ -381,7 +379,6 @@ const addon = require('./build/Release/addon');
console.log('This should be eight:', addon.add(3, 5));
```


### Callbacks

It is common practice within Addons to pass JavaScript functions to a C++
Expand Down Expand Up @@ -488,7 +485,6 @@ console.log(obj1.msg, obj2.msg);
// Prints: 'hello world'
```


### Function factory

Another common scenario is creating JavaScript functions that wrap C++
Expand Down Expand Up @@ -546,7 +542,6 @@ console.log(fn());
// Prints: 'hello world'
```


### Wrapping C++ objects

It is also possible to wrap C++ objects/classes in a way that allows new
Expand Down Expand Up @@ -713,6 +708,13 @@ console.log(obj.plusOne());
// Prints: 13
```

The garbage collector can execute forcefully using V8 command line flags
` --gc_global ` and ` --gc_interval `, where ` --gc_global ` forces V8 to
perform a full garbage collection and ` --gc_interval ` forces V8 to
perform garbage collection after a given amount of allocations. Although,
it is recommended to limit V8 command line flags for testing purposes
only, since these are primarily debug flags.

### Factory of wrapped objects

Alternatively, it is possible to use a factory pattern to avoid explicitly
Expand Down Expand Up @@ -916,7 +918,6 @@ console.log(obj2.plusOne());
// Prints: 23
```


### Passing wrapped objects around

In addition to wrapping and returning C++ objects, it is possible to pass
Expand Down
Loading