Welcome! Log In Create A New Profile

Advanced

[njs] Freeing code buffer after is was reallocated.

Dmitry Volyntsev
December 07, 2018 10:58AM
details: https://hg.nginx.org/njs/rev/bc7a47f35645
branches:
changeset: 688:bc7a47f35645
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Fri Dec 07 18:33:52 2018 +0300
description:
Freeing code buffer after is was reallocated.

Thanks to ??? (Hong Zhi Dao).

diffstat:

njs/njs_generator.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diffs (21 lines):

diff -r 2a13aff6aa1f -r bc7a47f35645 njs/njs_generator.c
--- a/njs/njs_generator.c Fri Dec 07 17:15:21 2018 +0300
+++ b/njs/njs_generator.c Fri Dec 07 18:33:52 2018 +0300
@@ -452,6 +452,8 @@ njs_generate_reserve(njs_vm_t *vm, njs_g
size = generator->code_end - generator->code_start;
memcpy(p, generator->code_start, size);

+ nxt_mem_cache_free(vm->mem_cache_pool, generator->code_start);
+
generator->code_start = p;
generator->code_end = p + size;

@@ -2223,6 +2225,8 @@ njs_generate_function_scope(njs_vm_t *vm
lambda->start = generator->code_start;
}

+ nxt_mem_cache_free(vm->mem_cache_pool, generator);
+
return ret;
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Freeing code buffer after is was reallocated.

Dmitry Volyntsev 110 December 07, 2018 10:58AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 86
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready