Skip to content

Commit dbb2864

Browse files
committed
ext/session: pack boolean globals
This reduces the size of the global struct from 448 bytes to 432 bytes
1 parent bc5f878 commit dbb2864

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

ext/session/php_session.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,19 @@ typedef struct _php_ps_globals {
133133
bool cookie_secure;
134134
bool cookie_httponly;
135135
bool cookie_partitioned;
136+
bool use_cookies;
137+
bool use_only_cookies;
138+
bool send_cookie;
139+
bool auto_start;
140+
bool define_sid;
136141
const ps_module *mod;
137142
const ps_module *default_mod;
138143
void *mod_data;
139144
php_session_status session_status;
145+
bool use_strict_mode; /* whether or not PHP accepts unknown session ids */
146+
bool lazy_write; /* omit session write when it is possible */
147+
bool in_save_handler; /* state if session is in save handler or not */
148+
bool set_handler; /* state if session module i setting handler or not */
140149
zend_string *session_started_filename;
141150
uint32_t session_started_lineno;
142151
int module_number;
@@ -157,15 +166,8 @@ typedef struct _php_ps_globals {
157166
zval ps_validate_sid;
158167
zval ps_update_timestamp;
159168
} mod_user_names;
160-
bool mod_user_implemented;
161-
bool mod_user_is_open;
162-
bool auto_start;
163-
bool use_cookies;
164-
bool use_only_cookies;
165-
bool use_trans_sid; /* contains the INI value of whether to use trans-sid */
166-
bool send_cookie;
167-
bool define_sid;
168169

170+
zend_string *session_vars; /* serialized original session data */
169171
const struct ps_serializer_struct *serializer;
170172
zval http_session_vars;
171173

@@ -180,11 +182,9 @@ typedef struct _php_ps_globals {
180182
bool rfc1867_enabled; /* session.upload_progress.enabled */
181183
bool rfc1867_cleanup; /* session.upload_progress.cleanup */
182184

183-
bool use_strict_mode; /* whether or not PHP accepts unknown session ids */
184-
bool lazy_write; /* omit session write when it is possible */
185-
bool in_save_handler; /* state if session is in save handler or not */
186-
bool set_handler; /* state if session module i setting handler or not */
187-
zend_string *session_vars; /* serialized original session data */
185+
bool mod_user_implemented;
186+
bool mod_user_is_open;
187+
bool use_trans_sid; /* contains the INI value of whether to use trans-sid */
188188
} php_ps_globals;
189189

190190
typedef php_ps_globals zend_ps_globals;

0 commit comments

Comments
 (0)