From 365901d28bee4ec7da7ca18e2c387702776c98e4 Mon Sep 17 00:00:00 2001 From: doujiang24 Date: Tue, 18 Oct 2016 11:02:00 +0800 Subject: [PATCH] optimize: optimized the shdict node struct memory layout which can save 8 bytes for every key-value pair on 64-bit systems, for example. sync from: https://github.com/openresty/lua-nginx-module/commit/da08f59ae5ff0f230595322b3a8ce48bd42f1b3f --- src/ngx_stream_lua_shdict.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ngx_stream_lua_shdict.h b/src/ngx_stream_lua_shdict.h index 83ee421d..b8967dcc 100644 --- a/src/ngx_stream_lua_shdict.h +++ b/src/ngx_stream_lua_shdict.h @@ -13,12 +13,11 @@ typedef struct { u_char color; - u_char dummy; - u_short key_len; - ngx_queue_t queue; - uint64_t expires; uint8_t value_type; + u_short key_len; uint32_t value_len; + uint64_t expires; + ngx_queue_t queue; uint32_t user_flags; u_char data[1]; } ngx_stream_lua_shdict_node_t;