diff options
Diffstat (limited to 'test/sequential/test-stringbytes-external-exceed-max.js')
-rw-r--r-- | test/sequential/test-stringbytes-external-exceed-max.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/sequential/test-stringbytes-external-exceed-max.js b/test/sequential/test-stringbytes-external-exceed-max.js index cf9dc37ec7..51c36c5521 100644 --- a/test/sequential/test-stringbytes-external-exceed-max.js +++ b/test/sequential/test-stringbytes-external-exceed-max.js @@ -17,9 +17,9 @@ assert(typeof gc === 'function', 'Run this test with --expose-gc'); const kStringMaxLength = process.binding('buffer').kStringMaxLength; try { - var buf = new Buffer(kStringMaxLength * 2 + 2); + var buf = Buffer.allocUnsafe(kStringMaxLength * 2 + 2); // Try to allocate memory first then force gc so future allocations succeed. - new Buffer(2 * kStringMaxLength); + Buffer.allocUnsafe(2 * kStringMaxLength); gc(); } catch (e) { // If the exception is not due to memory confinement then rethrow it. |