diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2012-02-03 16:32:00 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-02-06 15:44:42 +0100 |
commit | 74a8215a8699f89ee4b82ca616a4eafa3b11203b (patch) | |
tree | 1f2c8a7c47eae80a043c4b3ccf7372f4e8c7e292 /test/addons | |
parent | a9723df1b76777899a3819839cb7e8f0e2efaef1 (diff) | |
download | node-new-74a8215a8699f89ee4b82ca616a4eafa3b11203b.tar.gz |
Revert support for isolates.
It was decided that the performance benefits that isolates offer (faster spin-up
times for worker processes, faster inter-worker communication, possibly a lower
memory footprint) are not actual bottlenecks for most people and do not outweigh
the potential stability issues and intrusive changes to the code base that
first-class support for isolates requires.
Hence, this commit backs out all isolates-related changes.
Good bye, isolates. We hardly knew ye.
Diffstat (limited to 'test/addons')
-rw-r--r-- | test/addons/shared-buffer/binding.cc | 55 | ||||
-rw-r--r-- | test/addons/shared-buffer/binding.gyp | 8 | ||||
-rw-r--r-- | test/addons/shared-buffer/test.js | 19 |
3 files changed, 0 insertions, 82 deletions
diff --git a/test/addons/shared-buffer/binding.cc b/test/addons/shared-buffer/binding.cc deleted file mode 100644 index d81f1d4f22..0000000000 --- a/test/addons/shared-buffer/binding.cc +++ /dev/null @@ -1,55 +0,0 @@ -#include <node.h> -#include <v8.h> -#include <uv.h> - -using namespace v8; - -extern "C" { - void init(Handle<Object> target); -} - - -#define BUFSIZE 1024 -static uint8_t buf[BUFSIZE]; -static uv_mutex_t lock; - - -Handle<Value> Get(const Arguments& args) { - HandleScope scope; - - int index = args[0]->Uint32Value(); - - if (index < 0 || BUFSIZE <= index) { - return ThrowException(Exception::Error(String::New("out of bounds"))); - } - - return scope.Close(Integer::New(buf[index])); -} - - -Handle<Value> Set(const Arguments& args) { - uv_mutex_lock(&lock); - HandleScope scope; - - int index = args[0]->Uint32Value(); - - if (index < 0 || BUFSIZE <= index) { - return ThrowException(Exception::Error(String::New("out of bounds"))); - } - - buf[index] = args[1]->Uint32Value(); - - Local<Integer> val = Integer::New(buf[index]); - - uv_mutex_unlock(&lock); - - return scope.Close(val); -} - - -void init(Handle<Object> target) { - NODE_SET_METHOD(target, "get", Get); - NODE_SET_METHOD(target, "set", Set); - target->Set(String::New("length"), Integer::New(BUFSIZE)); - uv_mutex_init(&lock); -} diff --git a/test/addons/shared-buffer/binding.gyp b/test/addons/shared-buffer/binding.gyp deleted file mode 100644 index 3bfb84493f..0000000000 --- a/test/addons/shared-buffer/binding.gyp +++ /dev/null @@ -1,8 +0,0 @@ -{ - 'targets': [ - { - 'target_name': 'binding', - 'sources': [ 'binding.cc' ] - } - ] -} diff --git a/test/addons/shared-buffer/test.js b/test/addons/shared-buffer/test.js deleted file mode 100644 index 9ba896f28a..0000000000 --- a/test/addons/shared-buffer/test.js +++ /dev/null @@ -1,19 +0,0 @@ -var assert = require('assert'); -var binding = require('./out/Release/binding'); -var isolates = process.binding('isolates'); - -console.log("binding.length =", binding.length); - -if (process.tid === 1) { - var isolate = isolates.create(process.argv); - for (var i = 0; i < binding.length; i++) { - console.log('parent', - 'binding.set(' + i + ', ' + i + ')', - binding.set(i, i)); - } -} else { - for (var i = 0; i < binding.length; i++) { - console.log('child', 'binding.get(' + i + ')', binding.get(i)); - } -} - |