[njs] Disabling njs_retain() and njs_release().

Dmitry Volyntsev xeioex at nginx.com
Thu Apr 25 12:50:10 UTC 2019


details:   https://hg.nginx.org/njs/rev/793161f2708c
branches:  
changeset: 927:793161f2708c
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Thu Apr 25 15:50:03 2019 +0300
description:
Disabling njs_retain() and njs_release().

Until there is a working GC.

diffstat:

 njs/njs_vm.c |   4 ++--
 njs/njs_vm.h |  11 +++++++++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diffs (49 lines):

diff -r f5bdddca3252 -r 793161f2708c njs/njs_vm.c
--- a/njs/njs_vm.c	Thu Apr 25 15:19:37 2019 +0300
+++ b/njs/njs_vm.c	Thu Apr 25 15:50:03 2019 +0300
@@ -172,7 +172,7 @@ start:
 
         if (vmcode->code.retval) {
             retval = njs_vmcode_operand(vm, vmcode->operand1);
-            //njs_release(vm, retval);
+            njs_release(vm, retval);
             *retval = vm->retval;
         }
     }
@@ -2860,7 +2860,7 @@ njs_vmcode_restart(njs_vm_t *vm, njs_val
 
     retval = njs_vmcode_operand(vm, vmcode->operand1);
 
-    //njs_release(vm, retval);
+    njs_release(vm, retval);
 
     *retval = vm->retval;
 
diff -r f5bdddca3252 -r 793161f2708c njs/njs_vm.h
--- a/njs/njs_vm.h	Thu Apr 25 15:19:37 2019 +0300
+++ b/njs/njs_vm.h	Thu Apr 25 15:50:03 2019 +0300
@@ -562,6 +562,8 @@ typedef njs_ret_t (*njs_vmcode_operation
     (value)->type = NJS_INVALID
 
 
+#if 0 /* GC: todo */
+
 #define njs_retain(value)                                                     \
     do {                                                                      \
         if ((value)->data.truth == NJS_STRING_LONG) {                         \
@@ -577,6 +579,15 @@ typedef njs_ret_t (*njs_vmcode_operation
         }                                                                     \
     } while (0)
 
+#else
+
+#define njs_retain(value)
+
+
+#define njs_release(vm, value)
+
+#endif
+
 
 #define NJS_VMCODE_3OPERANDS   0
 #define NJS_VMCODE_2OPERANDS   1


More information about the nginx-devel mailing list