We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 13f460c commit 404e0c2Copy full SHA for 404e0c2
1 file changed
src/node_buffer.cc
@@ -229,12 +229,18 @@ MaybeLocal<Object> New(Isolate* isolate,
229
CHECK(actual <= length);
230
231
if (actual == 0) {
232
- free(data);
+ isolate->array_buffer_allocator()->Free(data, length);
233
data = nullptr;
234
- } else if (actual < length) {
+ }
235
+#if 0 //FIXME #4357: costs some extra bytes here. It shouldn't be
236
+ //significant because of the length calculation in
237
+ //StringBytes::Size()
238
+ //v8 buffer allocator doesn't support reallocate
239
+ else if (actual < length) {
240
data = static_cast<char*>(realloc(data, actual));
241
CHECK_NE(data, nullptr);
242
}
243
+#endif
244
245
246
Local<Object> buf;
0 commit comments