Commit Graph

2373 Commits (82c7c84e2550e79b816f87cd1dff3fe4cafb6bbb)

Author SHA1 Message Date
isaacs 6c5356bfe2 Revert "buffer: allocate memory with mmap()"
Also Revert "buffer: use MAP_ANON, fix OS X build"

This reverts commit ddb15603e7.
This reverts commit 2433ec8276.
2012-12-17 10:47:17 -08:00
Dean McNamee 1c265c54a2 typed arrays: fix missing type in SizeOfArrayElementForType()
When Mikael Bourges-Sevenier added support for Uint8ClampedArray in 67fc1da,
the new type was not added to SizeOfArrayElementForType().
2012-12-17 17:37:51 +01:00
Dean McNamee ba00fb0199 typed arrays: re-export SizeOfArrayElementForType()
Although it is not used externally by node, it is needed by upstream and Plask.

This effectively reverts:

    commit 1444801374
    Author: Aaron Jacobs <jacobsa@google.com>
    Date:   Thu Mar 15 13:26:35 2012 +1100

        typed arrays: unexport SizeOfArrayElementForType()

        It isn't used anywhere else, so made it an implementation detail in
        v8_typed_array.cc.
2012-12-17 17:37:51 +01:00
Ben Noordhuis ddb15603e7 buffer: use MAP_ANON, fix OS X build 2012-12-17 11:29:03 +01:00
Ben Noordhuis 2433ec8276 buffer: allocate memory with mmap()
Work around an issue with the glibc malloc() implementation where memory blocks
are never returned to the operating system when they are allocated with brk()
and have overlapping lifecycles.

Fixes #4283.
2012-12-16 10:19:09 +01:00
isaacs bb56dcc450 tty/stdin: Refactor for streams2 2012-12-14 10:52:30 -08:00
isaacs 0e01d6398f zlib: streams2 2012-12-14 10:52:26 -08:00
isaacs 372cb32dc4 module: Support cycles in native module requires 2012-12-13 17:00:23 -08:00
Ben Noordhuis 6cf68aead6 deps: upgrade libuv to e079a99 2012-12-13 20:23:01 +01:00
Ben Noordhuis 3ece130ea2 process: add getgroups(), setgroups(), initgroups()
DRY the getuid(), getgid(), etc. functions while we're at it.
2012-12-06 17:14:58 +01:00
Ben Noordhuis c08e947fbd buffer: remove unused #includes 2012-12-06 04:45:11 +01:00
Bert Belder 03b00dcca9 os: throw when os.networkInterfaces() fails 2012-12-03 22:35:01 +01:00
Fedor Indutny 51d5655efa crypto: fix leak in GetPeerCertificate 2012-12-03 20:30:41 +04:00
Ben Noordhuis 335f20896a crypto: allow negative numbers in setOptions()
OR'ing together two large values, like `SSL_OP_ALL | SSL_OP_NO_TICKET`,
produces a negative number. To wit:

  assert((0x80000000 | 0x4000) === -0x7fffc000); // true
  assert((0x80000000 | 0x4000) ===  0x80004000); // false!

It's easy to work around by doing a logical shift, like this:

  assert((0x80000000 | 0x4000) >>> 0 ===  0x80004000); // true

But that's not very intuitive. Let's be more lenient in what we accept.
2012-11-24 00:10:25 +01:00
Ben Noordhuis 8d2753c141 constants: fix wrapping of large constants
Use Number::New() instead of Integer::New(). The latter wraps large values,
e.g. 0x80000000 becomes -2147483648 instead of 2147483648.
2012-11-22 16:10:36 +01:00
Scott Blomquist f657ce685d windows: add tracing with performance counters
Patch by Henry Rawas and Scott Blomquist.
2012-11-21 01:21:53 +01:00
Sergey Kholodilov 019ad346e0 crypto: fix ssl error handling
Make HandleSSLError() correctly process a zero status code: sometimes it
indicates an error and sometimes it doesn't.
2012-11-17 00:52:58 +01:00
Ben Noordhuis 71ba7bc2a0 node: remove eio-emul.h
The purpose of this file was to remap the old libeio API to the new one.
We dropped libeio in ee77a6a and this file has been broken ever since.

Ergo, remove it.
2012-11-16 23:44:44 +01:00
Nathan Rajlich 5e4e87ade5 os: add os.endianness() function 2012-11-08 12:31:45 -08:00
Joshua Erickson fb6377ebd0 net: More accurate IP address validation and IPv6 dotted notation.
* Added isIP method to make use of inet_pton to cares_wrap.cc
* Modified net.isIP() to make use of new C++ isIP method.
* Added new tests to test-net-isip.js.
2012-11-06 16:49:21 +01:00
Anthony Pesch fddb5dc2d3 typed arrays: add slice() support to ArrayBuffer 2012-11-06 00:13:26 +01:00
Scott Blomquist 66f64ae072 windows: generate ETW events to track v8 compiled code positions
Patch by Henry Rawas and Scott Blomquist.
2012-11-01 14:06:26 +01:00
Jan Wynholds 06810b29fa tracing: add systemtap support 2012-11-01 01:25:22 +01:00
isaacs 07d3b21f43 zlib: s/clear/close/ and match other close() semantics 2012-10-31 16:56:30 -07:00
Ben Noordhuis a93424da4a zlib: pass object size hint to V8
Inform V8 that the zlib context object is tied to a large off-heap buffer.

This makes the GC run more often (in theory) and improves the accuracy of
--trace_external_memory.
2012-10-30 15:03:27 +01:00
Ben Noordhuis 570e4be932 zlib: reduce memory consumption, release early
In zlibBuffer(), don't wait for the garbage collector to reclaim the zlib memory
but release it manually. Reduces memory consumption by a factor of 10 or more
with some workloads.

Test case:

  function f() {
    require('zlib').deflate('xxx', g);
  }
  function g() {
    setTimeout(f, 5);
  }
  f();

Observe RSS memory usage with and without this commit. After 10,000 iterations,
RSS stabilizes at ~35 MB with this commit. Without, RSS is over 300 MB and keeps
growing.

Cause: whenever the JS object heap hits the high-water mark, the V8 GC sweeps
it clean, then tries to grow it in order to avoid more sweeps in the near
future. Rule of thumb: the bigger the JS heap, the lazier the GC can be.

A side effect of a bigger heap is that objects now live longer. This is harmless
in general but it affects zlib context objects because those are tied to large
buffers that live outside the JS heap, on the order of 16K per context object.

Ergo, don't wait for the GC to reclaim the memory - it may take a long time.

Fixes #4172.
2012-10-30 15:03:17 +01:00
isaacs 21c741f257 Print warning when maxTickDepth is reached 2012-10-29 10:53:39 -07:00
isaacs 78dbb15858 Now working on v0.9.4 2012-10-24 10:10:57 -07:00
isaacs 1ed4c6776e 2012.10.24, Version 0.9.3 (Unstable)
* V8: Upgrade to 3.13.7.4

* crypto: Default to buffers instead of binary strings (isaacs, Fedor Indutny)

* crypto: add getHashes() and getCiphers() (Ben Noordhuis)

* unix: add custom thread pool, remove libeio (Ben Noordhuis)

* util: make `inspect()` accept an "options" argument (Nathan Rajlich)

* https: fix renegotation attack protection (Ben Noordhuis)

* cluster: make 'listening' handler see actual port (Aaditya Bhatia)

* windows: use USERPROFILE to get the user's home dir (Bert Belder)

* path: add platform specific path delimiter (Paul Serby)

* http: add response.headersSent property (Pavel Lang)

* child_process: make .fork()'d child auto-exit (Ben Noordhuis)

* events: add 'removeListener' event (Ben Noordhuis)

* string_decoder: Add 'end' method, do base64 properly (isaacs)

* buffer: include encoding value in exception when invalid (Ricky Ng-Adam)

* http: make http.ServerResponse no longer emit 'end' (isaacs)

* streams: fix pipe is destructed by 'end' from destination (koichik)
2012-10-24 09:21:44 -07:00
isaacs 1122e3af28 crypto: Style. Prefer 'char*' over 'char *' 2012-10-23 10:48:51 -07:00
isaacs f2fa97f178 crypto: Remove many unnecessary toObjects 2012-10-23 10:48:51 -07:00
isaacs c87b524c5f crypto: Clean up buffer handling and DH methods 2012-10-23 10:48:51 -07:00
isaacs bfb9d5bbe6 crypto: Binding only accepts buffers 2012-10-23 10:48:50 -07:00
isaacs 18beea4a3f Merge remote-tracking branch 'ry/v0.8' 2012-10-23 08:22:47 -07:00
Aaron Jacobs 49f0f618a9 typed arrays: use `signed char` for signed int8s
The C standard allows plain `char` to be unsigned. The build environment
at Google trips this issue.
2012-10-23 16:55:59 +02:00
Ben Noordhuis 844a0058d0 crypto: fix DH use-after-free and memory leak
Fix a use-after-free bug and a memory leak in the error path of
DiffieHellman::ComputeSecret().

* the BIGNUM key was used after being freed with BN_free().
* the output buffer was not freed
2012-10-22 00:20:45 +02:00
Ben Noordhuis de18e29784 crypto: fix DH 1 byte buffer underflow
Passing a bad key to DiffieHellman::ComputeSecret() made it zero the byte
before the heap allocated buffer due to an erroneous size calculation.
2012-10-22 00:20:32 +02:00
Ben Noordhuis cb6d084d35 node: update description of --print 2012-10-20 15:03:48 +02:00
Nathan Rajlich 4b238b4c2a Merge remote-tracking branch 'origin/v0.8'
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/test/runner-win.c
	doc/api/process.markdown
	lib/repl.js
	src/node_crypto.cc
	src/node_version.h
2012-10-13 16:16:56 -07:00
Dean McNamee 47643d2ec5 typed arrays: remove unnecessary special-casing
Uint32Value() on undefined is equal to 0, no need to special case it.
2012-10-14 00:57:09 +02:00
Dean McNamee 93efc7f78d typed arrays: simplify typed array get() and set()
Instead of duplicating V8's logic (including clamping), just simply call into
V8's Get() and Set() methods, which handles all conversions and typing.
2012-10-14 00:54:20 +02:00
Ben Noordhuis 14a6c4efb8 crypto: add crypto.getHashes() 2012-10-13 02:55:14 +02:00
Ben Noordhuis f53441ab1f crypto: add crypto.getCiphers()
Returns a list of, unsurprisingly, the available ciphers.
2012-10-13 01:49:57 +02:00
isaacs 58db21e6c5 Now working on 0.8.13 2012-10-12 08:57:25 -07:00
isaacs 38c72d4e29 2012.10.12, Version 0.8.12 (Stable)
* npm: Upgrade to 1.1.63

* crypto: Reduce stability index to 2-Unstable (isaacs)

* windows: fix handle leak in uv_fs_utime (Bert Belder)

* windows: fix application crashed popup in debug version (Bert Belder)

* buffer: report proper retained size in profiler (Ben Noordhuis)

* buffer: fix byteLength with UTF-16LE (koichik)

* repl: make "end of input" JSON.parse() errors throw in the REPL (Nathan Rajlich)

* repl: make invalid RegExp modifiers throw in the REPL (Nathan Rajlich)

* http: handle multiple Proxy-Authenticate values (Willi Eggeling)
2012-10-11 14:34:11 -07:00
Ben Noordhuis 6a128e037e buffer: report proper retained size in profiler
Make buffers report the proper retained size in heap snapshots.

Before this commit, Buffer objects would show up in the heap profiler as being
only a few hundred bytes large, even if the actual buffer was many megabytes.
2012-10-11 01:05:18 +02:00
Ben Noordhuis eec8c2edaf crypto: fix -Wtautological-compare warning 2012-10-09 00:46:51 +02:00
Andrew Paprocki 8c5f269f90 Fix -Wsizeof-array-argument compiler warning. 2012-10-07 23:22:31 +02:00
koichik fbb0ee6f24 buffer: fix byteLength with UTF-16LE
Fixes #4075.
2012-10-04 18:18:15 +09:00
Ben Noordhuis 109f8e2773 node_http_parser: fix whitespace errors 2012-10-02 14:50:25 +02:00