Fixed allocating buffers above 2GB.#5
Conversation
Although the maximum length for buffer is 4GB check buffer.constants.MAX_LENGTH Added hint on initializing the context after creating the context.
|
I'm a bit confused. The original code doesn't look quite right but I'm not sure exactly what you are trying to achieve. While it seems unlikely to be used in the workflows I'm familiar with the underlying allocations support a buffer size specified as a 64-bit integer. If I were to make a change here I would look to read the JS number into a 64-bit value and pass it through to the allocation. This pull request allows a slightly larger buffer size to be passed in but it gets assigned to a 32-bit value just below. Comments? |
|
Problem is when allocating buffer above 2GB, the createBuffer fails and says that the buffer size cannot be (edit: negative). So, I thought this would help in future. Thanks |
Although the maximum length for buffer is 4GB
check buffer.constants.MAX_LENGTH
Added hint on initializing the context after creating the context.
Thanks
Karthick