summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheng Zhao <zcbenz@gmail.com>2014-08-10 10:46:11 +0800
committerFedor Indutny <fedor@indutny.com>2014-08-13 13:58:51 +0400
commit44743eaf24b0c0a7fbaa8d9aa04b4a211d8ec5e2 (patch)
tree9da548a60e5742aca1f09807c2401f6572c3dd10
parent807acf7f9871c6ee25915e7e159c9ea8b168028b (diff)
downloadnodejs-44743eaf24b0c0a7fbaa8d9aa04b4a211d8ec5e2.tar.gz
nodejs-44743eaf24b0c0a7fbaa8d9aa04b4a211d8ec5e2.tar.bz2
nodejs-44743eaf24b0c0a7fbaa8d9aa04b4a211d8ec5e2.zip
src: change kIsolateSlot to 3
The slot 0 and 1 had already been taken by "gin" and "blink" in Chrome, and the size of isolate's slots is 4 by default, so using 3 should hopefully make node work independently when embedded into other application. Reviewed-By: Fedor Indutny <fedor@indutny.com>
-rw-r--r--src/env.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/env.h b/src/env.h
index fba0ce975..4a26dd112 100644
--- a/src/env.h
+++ b/src/env.h
@@ -37,8 +37,8 @@
// a nightmare so let's make the preprocessor generate them for us.
//
// Make sure that any macros defined here are undefined again at the bottom
-// of context-inl.h. The sole exception is NODE_CONTEXT_EMBEDDER_DATA_INDEX,
-// it may have been defined externally.
+// of context-inl.h. The exceptions are NODE_CONTEXT_EMBEDDER_DATA_INDEX
+// and NODE_ISOLATE_SLOT, they may have been defined externally.
namespace node {
// Pick an index that's hopefully out of the way when we're embedded inside
@@ -49,6 +49,14 @@ namespace node {
#define NODE_CONTEXT_EMBEDDER_DATA_INDEX 32
#endif
+// The slot 0 and 1 had already been taken by "gin" and "blink" in Chrome,
+// and the size of isolate's slots is 4 by default, so using 3 should
+// hopefully make node work independently when embedded into other
+// application.
+#ifndef NODE_ISOLATE_SLOT
+#define NODE_ISOLATE_SLOT 3
+#endif
+
// Strings are per-isolate primitives but Environment proxies them
// for the sake of convenience.
#define PER_ISOLATE_STRING_PROPERTIES(V) \
@@ -430,7 +438,7 @@ class Environment {
#undef V
private:
- static const int kIsolateSlot = 0;
+ static const int kIsolateSlot = NODE_ISOLATE_SLOT;
class GCInfo;
class IsolateData;