0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

8 Commits

Author SHA1 Message Date
Sam Roberts
60b315c064 src: remove env-inl.h from header files
Inline headers should only be included into the .cc files that use them.

PR-URL: https://github.com/nodejs/node/pull/27755
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-05-23 08:51:41 -07:00
Joyee Cheung
0ae46a7a86
src: use predefined AliasedBuffer types in the code base
Instead of allowing the callers to instantiate the template
with any numeric types (such as aliasing a Uint8Array to double[]),
predefine types that make sense and use those instead.

PR-URL: https://github.com/nodejs/node/pull/27334
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-04-26 14:23:31 +08:00
Anna Henningsen
bd6dc9ebab
src: replace template<template <
PR-URL: https://github.com/nodejs/node/pull/20675
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-05-14 18:09:23 +02:00
Anna Henningsen
19c9ff5a92 test: plug AliasedBuffer cctest memory leak
No need to heap-allocate values here.

PR-URL: https://github.com/nodejs/node/pull/20665
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-05-12 16:26:40 -07:00
Daniel Bevenius
45277e23d5 src: add incr/decr operators for Reference
This commit adds operator overloads for increment/decrement to
AliasedBuffer::Reference.
The motivation for doing this is to hopefully make code that needs
to increment/decrement a little simpler.

PR-URL: https://github.com/nodejs/node/pull/19083
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-03-09 08:01:20 -08:00
Daniel Bevenius
83c93158fb test: remove destructor from node_test_fixture
This commit removes the destructor from node_test_fixture.h which calls
the TearDown function causing TearDown to be called twice. This also
allows us to remove the check of the platform_ in TearDown.

Also the Setup/TearDown functions in AliasBufferTest are removed as they
are not necessary.

PR-URL: https://github.com/nodejs/node/pull/18524
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-02-05 06:58:05 +01:00
Mike Kaufman
6faede7eb4
test: fixing AliasedBuffer tests to enter Isolate
AliasedBuffer tests weren't creating an v8::Isolate::Scope, and this
had negative impact on the node-chakracore branch, where expectation
is an Isoalte has been Enter()'d before being used.

PR-URL: https://github.com/nodejs/node/pull/15536
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-09-24 13:35:58 -03:00
Mike Kaufman
35a526c1d4
http2,async-wrap: introduce AliasedBuffer class
This change introduces an AliasedBuffer class and updates asytnc-wrap
and http2 to use this class.

A common technique to optimize performance is to create a native buffer
and then map that native buffer to user space via JS array.  The runtime
can efficiently write to the native buffer without having to route
though JS, and the values being written are accessible from user space.

While efficient, this technique allows modifications to user
space memory w/out going through JS type system APIs, effectively
bypassing any monitoring the JS VM has in place to track program state
modifications.  The result is that monitors have an incorrect view
of prorgram state.

The AliasedBuffer class provides a future placeholder where this
technique can be used, but writes can still be observed.  To achieve
this, the node-chakra-core fork will add in appropriate tracking logic
in the AliasedBuffer's SetValue() method. Going forward, this class can
evolve to support more sophisticated mechanisms if necessary.

PR-URL: https://github.com/nodejs/node/pull/15077
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-09-13 17:44:24 +02:00