[njs] Fixed njs_vm_t struct alignment on 32bits platforms.

Dmitry Volyntsev xeioex at nginx.com
Thu Mar 22 12:05:26 UTC 2018


details:   http://hg.nginx.org/njs/rev/f58d5003ba33
branches:  
changeset: 467:f58d5003ba33
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Thu Mar 22 15:05:08 2018 +0300
description:
Fixed njs_vm_t struct alignment on 32bits platforms.

diffstat:

 njs/njscript.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 529c376ec5e2 -r f58d5003ba33 njs/njscript.c
--- a/njs/njscript.c	Thu Mar 22 15:05:06 2018 +0300
+++ b/njs/njscript.c	Thu Mar 22 15:05:08 2018 +0300
@@ -337,7 +337,7 @@ njs_vm_clone(njs_vm_t *vm, njs_external_
         return NULL;
     }
 
-    nvm = nxt_mem_cache_zalloc(nmcp, sizeof(njs_vm_t));
+    nvm = nxt_mem_cache_zalign(nmcp, sizeof(njs_value_t), sizeof(njs_vm_t));
 
     if (nxt_fast_path(nvm != NULL)) {
         nvm->mem_cache_pool = nmcp;


More information about the nginx-devel mailing list