8000 Buffer, refactor: not save ArrayBuffer into Global. · fibjs/fibjs@64ea150 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 64ea150

Browse files
committed
Buffer, refactor: not save ArrayBuffer into Global.
1 parent 32fc76f commit 64ea150

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

fibjs/include/Buffer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ class Buffer : public Buffer_base {
128128

129129
private:
130130
std::shared_ptr<v8::BackingStore> m_store;
131-
v8::Global<v8::ArrayBuffer> m_buf;
132131
};
133132

134133
}

fibjs/src/global/Buffer.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,7 @@ v8::Local<v8::Object> Buffer::wrap(Isolate* isolate, v8::Local<v8::Object> This)
235235
{
236236
if (!hasJSHandle()) {
237237
v8::Local<v8::Context> context = isolate->context();
238-
v8::Local<v8::ArrayBuffer> buf;
239-
240-
if (m_buf.IsEmpty()) {
241-
buf = v8::ArrayBuffer::New(isolate->m_isolate, m_store);
242-
m_buf.Reset(isolate->m_isolate, buf);
243-
} else
244-
buf = m_buf.Get(isolate->m_isolate);
238+
v8::Local<v8::ArrayBuffer> buf = v8::ArrayBuffer::New(isolate->m_isolate, m_store);
245239

246240
v8::Local<v8::Object> proto;
247241
v8::Local<v8::Uint8Array> ui;

0 commit comments

Comments
 (0)
0