We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1be49af commit 6542755Copy full SHA for 6542755
1 file changed
src/node_buffer.cc
@@ -243,12 +243,18 @@ MaybeLocal<Object> New(Isolate* isolate,
243
CHECK(actual <= length);
244
245
if (actual == 0) {
246
- free(data);
+ isolate->array_buffer_allocator()->Free(data, length);
247
data = nullptr;
248
- } else if (actual < length) {
+ }
249
+#if 0 //FIXME #4357: costs some extra bytes here. It shouldn't be
250
+ //significant because of the length calculation in
251
+ //StringBytes::Size()
252
+ //v8 buffer allocator doesn't support reallocate
253
+ else if (actual < length) {
254
data = static_cast<char*>(realloc(data, actual));
255
CHECK_NE(data, nullptr);
256
}
257
+#endif
258
259
260
Local<Object> buf;
0 commit comments