Welcome! Log In Create A New Profile

Advanced

[njs] Initialize njs_vm_opt_t structs to 0 to simplify options adding.

Dmitry Volyntsev
July 17, 2017 09:08AM
details: http://hg.nginx.org/njs/rev/182d765687ee
branches:
changeset: 387:182d765687ee
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Mon Jul 17 15:29:02 2017 +0300
description:
Initialize njs_vm_opt_t structs to 0 to simplify options adding.

diffstat:

nginx/ngx_http_js_module.c | 3 ++-
nginx/ngx_stream_js_module.c | 3 ++-
njs/test/njs_benchmark.c | 4 ++--
njs/test/njs_unit_test.c | 3 ++-
4 files changed, 8 insertions(+), 5 deletions(-)

diffs (57 lines):

diff -r bef6842774f6 -r 182d765687ee nginx/ngx_http_js_module.c
--- a/nginx/ngx_http_js_module.c Mon Jul 17 14:46:35 2017 +0300
+++ b/nginx/ngx_http_js_module.c Mon Jul 17 15:29:02 2017 +0300
@@ -1319,8 +1319,9 @@ ngx_http_js_include(ngx_conf_t *cf, ngx_
return NGX_CONF_ERROR;
}

+ ngx_memzero(&options, sizeof(njs_vm_opt_t));
+
options.mcp = mcp;
- options.shared = NULL;
options.externals = &externals;

jlcf->vm = njs_vm_create(&options);
diff -r bef6842774f6 -r 182d765687ee nginx/ngx_stream_js_module.c
--- a/nginx/ngx_stream_js_module.c Mon Jul 17 14:46:35 2017 +0300
+++ b/nginx/ngx_stream_js_module.c Mon Jul 17 15:29:02 2017 +0300
@@ -1029,8 +1029,9 @@ ngx_stream_js_include(ngx_conf_t *cf, ng
return NGX_CONF_ERROR;
}

+ ngx_memzero(&options, sizeof(njs_vm_opt_t));
+
options.mcp = mcp;
- options.shared = NULL;
options.externals = &externals;

jscf->vm = njs_vm_create(&options);
diff -r bef6842774f6 -r 182d765687ee njs/test/njs_benchmark.c
--- a/njs/test/njs_benchmark.c Mon Jul 17 14:46:35 2017 +0300
+++ b/njs/test/njs_benchmark.c Mon Jul 17 15:29:02 2017 +0300
@@ -88,9 +88,9 @@ njs_unit_test_benchmark(nxt_str_t *scrip
return NXT_ERROR;
}

+ memset(&options, 0, sizeof(njs_vm_opt_t));
+
options.mcp = mcp;
- options.shared = NULL;
- options.externals = NULL;

vm = njs_vm_create(&options);
if (vm == NULL) {
diff -r bef6842774f6 -r 182d765687ee njs/test/njs_unit_test.c
--- a/njs/test/njs_unit_test.c Mon Jul 17 14:46:35 2017 +0300
+++ b/njs/test/njs_unit_test.c Mon Jul 17 15:29:02 2017 +0300
@@ -8161,8 +8161,9 @@ njs_unit_test(nxt_bool_t disassemble)
(int) njs_test[i].script.length, njs_test[i].script.start);
fflush(stdout);

+ memset(&options, 0, sizeof(njs_vm_opt_t));
+
options.mcp = mcp;
- options.shared = NULL;
options.externals = &externals;

vm = njs_vm_create(&options);
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Initialize njs_vm_opt_t structs to 0 to simplify options adding.

Dmitry Volyntsev 652 July 17, 2017 09:08AM



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

Online Users

Guests: 304
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready