diff options
author | Fedor Indutny <fedor@indutny.com> | 2015-03-06 14:58:24 -0500 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2015-03-08 19:07:46 -0400 |
commit | 8670613d2d5dbfc191678caffe4c2bd228147046 (patch) | |
tree | 70f26051e5f669197f49560adbfa4d5bbd0c0fc4 /src/node_crypto_bio.cc | |
parent | f8c893dd39d2dc03bddd4a7a036484df027c94d6 (diff) | |
download | android-node-v8-8670613d2d5dbfc191678caffe4c2bd228147046.tar.gz android-node-v8-8670613d2d5dbfc191678caffe4c2bd228147046.tar.bz2 android-node-v8-8670613d2d5dbfc191678caffe4c2bd228147046.zip |
node_crypto_bio: adjust external memory size
Adjust V8's external memory size when allocating buffers for TLS data to
ensure that V8 has enough information to trigger the GC at right time.
PR-URL: https://github.com/iojs/io.js/pull/1085
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node_crypto_bio.cc')
-rw-r--r-- | src/node_crypto_bio.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/node_crypto_bio.cc b/src/node_crypto_bio.cc index 95971359cb..c28e118c3b 100644 --- a/src/node_crypto_bio.cc +++ b/src/node_crypto_bio.cc @@ -27,6 +27,11 @@ BIO* NodeBIO::New() { } +void NodeBIO::AssignEnvironment(Environment* env) { + env_ = env; +} + + int NodeBIO::New(BIO* bio) { bio->ptr = new NodeBIO(); @@ -399,7 +404,7 @@ void NodeBIO::TryAllocateForWrite(size_t hint) { kThroughputBufferLength; if (len < hint) len = hint; - Buffer* next = new Buffer(len); + Buffer* next = new Buffer(env_, len); if (w == nullptr) { next->next_ = next; |