details: https://hg.nginx.org/njs/rev/c0aad58cfadb branches: changeset: 2215:c0aad58cfadb user: Dmitry Volyntsev <xei...@nginx.com> date: Wed Oct 04 13:35:38 2023 -0700 description: Improved memory footprint of RegExp.prototype.split().
diffstat: src/njs_regexp.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diffs (44 lines): diff -r cf85d0f8640a -r c0aad58cfadb src/njs_regexp.c --- a/src/njs_regexp.c Tue Oct 03 18:09:06 2023 -0700 +++ b/src/njs_regexp.c Wed Oct 04 13:35:38 2023 -0700 @@ -1773,6 +1773,10 @@ njs_regexp_prototype_symbol_split(njs_vm e = njs_min(e, length); if (e == p) { + if (njs_object_slots(&z)) { + njs_regexp_exec_result_free(vm, njs_array(&z)); + } + q = q + 1; continue; } @@ -1794,6 +1798,10 @@ njs_regexp_prototype_symbol_split(njs_vm } if (array->length == limit) { + if (njs_object_slots(&z)) { + njs_regexp_exec_result_free(vm, njs_array(&z)); + } + goto done; } @@ -1818,10 +1826,18 @@ njs_regexp_prototype_symbol_split(njs_vm } if (array->length == limit) { + if (njs_object_slots(&z)) { + njs_regexp_exec_result_free(vm, njs_array(&z)); + } + goto done; } } + if (njs_object_slots(&z)) { + njs_regexp_exec_result_free(vm, njs_array(&z)); + } + q = p; } _______________________________________________ nginx-devel mailing list nginx-devel@nginx.org https://mailman.nginx.org/mailman/listinfo/nginx-devel