[njs] Removing the requirement of "aligned" attribute support.

Dmitry Volyntsev xeioex at nginx.com
Mon May 31 07:22:27 UTC 2021


details:   https://hg.nginx.org/njs/rev/7d835eb234e1
branches:  
changeset: 1646:7d835eb234e1
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Mon May 31 06:55:32 2021 +0000
description:
Removing the requirement of "aligned" attribute support.

Before 0a2a0b5a74f4, the address of values used in runtime had to be the
multiple of 16, because the address of a variable was used as its VM
index. The first 4 bits of an index signified the scope of a varible.

This is no longer the case, after 0a2a0b5a74f4 the address of a variable
is never used as its VM index.

diffstat:

 src/njs_value.h |  4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diffs (14 lines):

diff -r fc510b2e4f3a -r 7d835eb234e1 src/njs_value.h
--- a/src/njs_value.h	Fri May 28 15:23:03 2021 +0000
+++ b/src/njs_value.h	Mon May 31 06:55:32 2021 +0000
@@ -105,10 +105,6 @@ typedef struct njs_property_next_s    nj
 typedef struct njs_object_init_s      njs_object_init_t;
 
 
-#if (!NJS_HAVE_GCC_ATTRIBUTE_ALIGNED)
-#error "aligned attribute is required"
-#endif
-
 union njs_value_s {
     /*
      * The njs_value_t size is 16 bytes and must be aligned to 16 bytes


More information about the nginx-devel mailing list