[njs] Added njs_vm_external_ptr().

Dmitry Volyntsev xeioex at nginx.com
Thu Dec 8 02:13:57 UTC 2022


details:   https://hg.nginx.org/njs/rev/61357fb10f4a
branches:  
changeset: 2012:61357fb10f4a
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed Dec 07 18:11:56 2022 -0800
description:
Added njs_vm_external_ptr().

diffstat:

 src/njs.h    |  1 +
 src/njs_vm.c |  7 +++++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diffs (28 lines):

diff -r 68b28e924908 -r 61357fb10f4a src/njs.h
--- a/src/njs.h	Wed Dec 07 18:11:56 2022 -0800
+++ b/src/njs.h	Wed Dec 07 18:11:56 2022 -0800
@@ -397,6 +397,7 @@ NJS_EXPORT njs_function_t *njs_vm_functi
 NJS_EXPORT njs_value_t *njs_vm_retval(njs_vm_t *vm);
 NJS_EXPORT void njs_vm_retval_set(njs_vm_t *vm, const njs_value_t *value);
 NJS_EXPORT njs_mp_t *njs_vm_memory_pool(njs_vm_t *vm);
+NJS_EXPORT njs_external_ptr_t njs_vm_external_ptr(njs_vm_t *vm);
 
 /*  Gets string value, no copy. */
 NJS_EXPORT void njs_value_string_get(njs_value_t *value, njs_str_t *dst);
diff -r 68b28e924908 -r 61357fb10f4a src/njs_vm.c
--- a/src/njs_vm.c	Wed Dec 07 18:11:56 2022 -0800
+++ b/src/njs_vm.c	Wed Dec 07 18:11:56 2022 -0800
@@ -663,6 +663,13 @@ njs_vm_memory_pool(njs_vm_t *vm)
 }
 
 
+njs_external_ptr_t
+njs_vm_external_ptr(njs_vm_t *vm)
+{
+    return vm->external;
+}
+
+
 uintptr_t
 njs_vm_meta(njs_vm_t *vm, njs_uint_t index)
 {



More information about the nginx-devel mailing list