]> git.kaiwu.me - njs.git/commit
Fixed Array.prototype.sort() with --debug=YES and --debug-memory=YES.
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 6 Oct 2023 23:52:23 +0000 (16:52 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Fri, 6 Oct 2023 23:52:23 +0000 (16:52 -0700)
commit280d11299e83bcc6098c2bc133ede54da9e700da
tree48fab294e680071a8a501699f73749f9115013cc
parentf7813172c2a6dd32abd154548d5ad13200b0bef7
Fixed Array.prototype.sort() with --debug=YES and --debug-memory=YES.

Previously, --debug-memory=YES activated a different allocation
mechanism that was not able to properly handle the 0 size allocation.
Specifically, njs_mp_free() failed to find a block to free when the size
of the block is 0.

The fix is to alloc at least 1 byte in the --debug-memory=YES mode.
src/njs_array.c
src/njs_mp.c