Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nodejs/node-v0.x-archive
base: 202b5db4efd0
Choose a base ref
...
head repository: nodejs/node-v0.x-archive
compare: 01ee551e7047
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Feb 6, 2013

  1. typed arrays: only share ArrayBuffer backing store

    Follow browser behavior, only share the backing store when it's a
    ArrayBuffer. That is:
    
      var abuf = new ArrayBuffer(32);
      var a = new Int8Array(abuf);
      var b = new Int8Array(abuf);
      a[0] = 0;
      b[0] = 1;
      assert(a[0] === b[0]);  // a and b share memory
    
    But:
    
      var a = new Int8Array(32);
      var b = new Int8Array(a);
      a[0] = 0;
      b[0] = 1;
      assert(a[0] !== b[0]);  // a and b don't share memory
    
    The typed arrays spec allows both `a[0] === b[0]` and `a[0] !=== b[0]`
    but Chrome and Firefox implement the behavior where memory is not
    shared.
    
    Copying the memory is less efficient but let's do it anyway for the
    sake of the Principle of Least Surprise.
    
    Fixes #4714.
    bnoordhuis committed Feb 6, 2013
    Copy the full SHA
    01ee551 View commit details
    Browse the repository at this point in the history