Closed hnakamur closed 2 years ago
I got this error when I was trying the benchmark at https://github.com/coilhq/tigerbeetle/tree/466fb090bde0203fae396542a1865f16d97a8bd2/demos/hash_table#nodejs
I looked at the Node.js document and found out the value buffer.kMaxLength in Node.js 16.x is different from one in Node.js 14.x.
buffer.kMaxLength
An alias for buffer.constants.MAX_LENGTH.
Node.js 14.x buffer.constants.MAX_LENGTH
On 64-bit architectures, this value currently is 2^32 - 1 (~4GB).
Node.js 16.x buffer.constants.MAX_LENGTH
On 64-bit architectures, this value currently is 2^32 (about 4 GB).
The assertion error does not happen when I replace Math.pow(2, 32) - 1 at https://github.com/ronomon/hash-table/blob/a951174315bb6980b85a31e46f144d7ca2c1cd4b/index.js#L228 with Math.pow(2, 32).
Math.pow(2, 32) - 1
Math.pow(2, 32)
Thanks @hnakamur !
It should be fixed in @ronomon/hash-table@2.0.8, if you reinstall the module.
I got this error when I was trying the benchmark at https://github.com/coilhq/tigerbeetle/tree/466fb090bde0203fae396542a1865f16d97a8bd2/demos/hash_table#nodejs
I looked at the Node.js document and found out the value
buffer.kMaxLength
in Node.js 16.x is different from one in Node.js 14.x.buffer.kMaxLength
Node.js 14.x buffer.constants.MAX_LENGTH
Node.js 16.x buffer.constants.MAX_LENGTH
The assertion error does not happen when I replace
Math.pow(2, 32) - 1
at https://github.com/ronomon/hash-table/blob/a951174315bb6980b85a31e46f144d7ca2c1cd4b/index.js#L228 withMath.pow(2, 32)
.