1. Jun 19, 2013
    • Trevor Norris's avatar
      buffer: expose class methods alloc and dispose · fb40da82
      Trevor Norris authored
      Expose the ability for users to allocate and manually dispose data on
      any object. These are user-safe versions of internal smalloc functions.
      fb40da82
    • Trevor Norris's avatar
      buffer: reimplement Buffer pools · 456942a9
      Trevor Norris authored
      While the new Buffer implementation is much faster we still have the
      necessity of using Buffer pools. This is undesirable because it may
      still lead to unwanted memory retention, but for the time being this is
      the best solution.
      
      Because of this re-introduction, and since there is no more SlowBuffer
      type, the SlowBuffer method has been re-purposed to return a non-pooled
      Buffer instance. This will be helpful for developers to store data for
      indeterminate lengths of time without introducing a memory leak.
      
      Another change to Buffer pools was that they are only allocated if the
      requested chunk is < poolSize / 2. This was done because allocations are
      much quicker now, and it's a better use of the pool.
      456942a9
    • Trevor Norris's avatar
      buffer: use smalloc as backing data store · 3a2f273b
      Trevor Norris authored
      Memory allocations are now done through smalloc. The Buffer cc class has
      been removed completely, but for backwards compatibility have left the
      namespace as Buffer.
      
      The .parent attribute is only set if the Buffer is a slice of an
      allocation. Which is then set to the alloc object (not a Buffer).
      
      The .offset attribute is now a ReadOnly set to 0, for backwards
      compatibility. I'd like to remove it in the future (pre v1.0).
      
      A few alterations have been made to how arguments are either coerced or
      thrown. All primitives will now be coerced to their respective values,
      and (most) all out of range index requests will throw.
      
      The indexes that are coerced were left for backwards compatibility. For
      example: Buffer slice operates more like Array slice, and coerces
      instead of throwing out of range indexes. This may change in the future.
      
      The reason for wanting to throw for out of range indexes is because
      giving js access to raw memory has high potential risk. To mitigate that
      it's easier to make sure the developer is always quickly alerted to the
      fact that their code is attempting to access beyond memory bounds.
      
      Because SlowBuffer will be deprecated, and simply returns a new Buffer
      instance, all tests on SlowBuffer have been removed.
      
      Heapdumps will now show usage under "smalloc" instead of "Buffer".
      
      ParseArrayIndex was added to node_internals to support proper uint
      argument checking/coercion for external array data indexes.
      
      SlabAllocator had to be updated since handle_ no longer exists.
      3a2f273b
    • Trevor Norris's avatar
      smalloc: add api to manually dispose Persistent · 252cdfa4
      Trevor Norris authored
      If the user knows the allocation is no longer needed then the memory can
      be manually released.
      
      Currently this will not ClearWeak the Persistent, so the callback will
      still run.
      
      If the user passed a ClearWeak callback, and then disposed the object,
      the buffer callback argument will == NULL.
      252cdfa4
    • Trevor Norris's avatar
      smalloc: initial implementation · 8f3f9f78
      Trevor Norris authored
      smalloc is a simple utility for quickly allocating external memory onto
      js objects. This will be used to centralize how memory is managed in
      node, and will become the backer for Buffers. So in the future crypto's
      SlabBuffer, stream's SlabAllocator will be removed.
      
      Note on the js API: because no arguments are optional the order of
      arguments have been placed to match their cc counterparts as closely as
      possible.
      8f3f9f78
  2. Jun 18, 2013
  3. Jun 17, 2013
    • Linus Mårtensson's avatar
      build: add android support · 5e4e8ec4
      Linus Mårtensson authored
      Resolves minor discrepancies between android and standard POSIX systems.
      In addition, some configure parameters were added, and a helper-script
      for android configuration. Ideally, this script should be merged into
      the standard configure script.
      
      To build for android, source the android-configure script with an NDK
      path:
      
          source ./android-configure ~/android-ndk-r8d
      
      This will create an android standalone toolchain and export the
      necessary environment parameters.
      
      After that, build as normal:
      
          make -j8
      
      After the build, you should now have android-compatible NodeJS binaries.
      5e4e8ec4
    • Krzysztof Chrapka's avatar
      readline: strip ctrl chars for prompt width calc · ffcd8b94
      Krzysztof Chrapka authored
      Use regular expression to strip vt ansi escape codes from display when
      calulating prompt display width and cursor position
      
      Fixes #3860 and #5628.
      ffcd8b94
    • Fedor Indutny's avatar
      tls: session API returns · 212e9cd8
      Fedor Indutny authored
      212e9cd8
    • isaacs's avatar
      doc: Correct TLS deprecation notices · 0a4260c8
      isaacs authored
      0a4260c8
    • Ben Noordhuis's avatar
      0581f5cb
    • Ben Noordhuis's avatar
      cares: fix uninitialized variable warning · 70a75cd4
      Ben Noordhuis authored
      Suppress the following warning:
      
        ../../src/cares_wrap.cc: In function ‘v8::Handle<v8::Value>
        node::cares_wrap::SetServers(const v8::Arguments&)’:
        ../../src/cares_wrap.cc:1017:5: warning: ‘uv_ret.uv_err_s::code’
        may be used uninitialized in this function [-Wuninitialized]
      70a75cd4
  4. Jun 16, 2013
  5. Jun 14, 2013
  6. Jun 13, 2013
    • Trevor Norris's avatar
      string_bytes: write strings using new API · e92f4879
      Trevor Norris authored
      StringBytes::Write now uses new v8 API and also does preliminary check
      if the string is external, then will use external memory instead.
      e92f4879
    • Trevor Norris's avatar
      string_bytes: use external for large strings · 642ea2b6
      Trevor Norris authored
      When large strings are used they cause v8's GC to spend a lot more time
      cleaning up. In these cases it's much faster to use external string
      resources.
      
      UTF8 strings do not use external string resources because only one and
      two byte external strings are supported.
      
      EXTERN_APEX is the value at which v8's GC overtakes performance.
      
      The following table has the type and buffer size that use to encode the
      strings as rough estimates of the percentage of performance gain from
      this patch (UTF8 is missing because they cannot be externalized).
      
      encoding  128KB    1MB    5MB
      -----------------------------
      ASCII       58%   208%   250%
      HEX         15%    74%    86%
      BASE64      11%    74%    71%
      UCS2         2%   225%   398%
      BINARY    2234%  1728%  2305%
      
      BINARY is so much faster across the board because of using the new v8
      WriteOneByte API.
      642ea2b6
  7. Jun 12, 2013
  8. Jun 08, 2013
    • Fedor Indutny's avatar
      crypto: free excessive memory in NodeBIO · 9ae1d182
      Fedor Indutny authored
      Before this commit NodeBIO never shrank, possibly consuming a lot of
      memory (depending on reader's haste).
      
      All buffers between write_head's child and read_head should be
      deallocated on read, leaving only space left in write_head and in the
      next buffer.
      9ae1d182
  9. Jun 07, 2013
    • Ben Noordhuis's avatar
      src: unexport node_isolate · 4bb4f734
      Ben Noordhuis authored
      Commit 0bba5902 accidentally (or maybe erroneously) added node_isolate
      to src/node.h and src/node_object_wrap.h.
      
      Undo that, said variable is not for public consumption. Add-on authors
      should use v8::Isolate::GetCurrent() instead.
      
      I missed that while reviewing. Mea culpa.
      
      Fixes #5639.
      4bb4f734
  10. Jun 06, 2013
    • isaacs's avatar
      Merge remote-tracking branch 'ry/v0.10' · 0882a750
      isaacs authored
      Conflicts:
      	ChangeLog
      	deps/uv/AUTHORS
      	deps/uv/ChangeLog
      	deps/uv/src/unix/linux-core.c
      	deps/uv/src/version.c
      	deps/uv/src/win/timer.c
      	lib/url.js
      	src/node_version.h
      	test/simple/test-url.js
      0882a750
  11. Jun 05, 2013
    • isaacs's avatar
      net: Destroy when not readable and not writable · e0519ace
      isaacs authored
      This is only relevant for CentOS 6.3 using kernel version 2.6.32.
      
      On other linuxes and darwin, the `read` call gets an ECONNRESET in that
      case.  On sunos, the `write` call fails with EPIPE.
      
      However, old CentOS will occasionally send an EOF instead of a
      ECONNRESET or EPIPE when the client has been destroyed abruptly.
      
      Make sure we don't keep trying to write or read more in that case.
      
      Fixes #5504
      
      However, there is still the question of what libuv should do when it
      gets an EOF.  Apparently in this case, it will continue trying to read,
      which is almost certainly the wrong thing to do.
      
      That should be fixed in libuv, even though this works around the issue.
      e0519ace
    • isaacs's avatar
      Now working on v0.10.11 · 6ada7338
      isaacs authored
      6ada7338
    • isaacs's avatar
      blog: Release v0.10.10 · 59c8f591
      isaacs authored
      59c8f591