Skip to content

Commit a7ddb6c

Browse files
committed
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: openresty/lua-nginx-module@da08f59
1 parent aafd50b commit a7ddb6c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/ngx_stream_lua_shdict.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@
1313

1414
typedef struct {
1515
u_char color;
16-
u_char dummy;
17-
u_short key_len;
18-
ngx_queue_t queue;
19-
uint64_t expires;
2016
uint8_t value_type;
17+
u_short key_len;
2118
uint32_t value_len;
19+
uint64_t expires;
20+
ngx_queue_t queue;
2221
uint32_t user_flags;
2322
u_char data[1];
2423
} ngx_stream_lua_shdict_node_t;

0 commit comments

Comments
 (0)