com php-src: Reduce struct size, on 64-bit by 8 bytes each: Zend/zend_ini.h
| From: | Anatol Belski | Date: | Fri, 28 Jul 2017 18:02:26 +0000 |
| Subject: | com php-src: Reduce struct size, on 64-bit by 8 bytes each: Zend/zend_ini.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-98853@lists.php.net to get a copy of this message | ||
Commit: 853e73fb8e70f7d4a74d3a90f2d981da09b21640
Author: Anatol Belski <ab@php.net> Fri, 28 Jul 2017 20:02:26 +0200
Parents: 095d763f998970ba999801b26d963b580debb037
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=853e73fb8e70f7d4a74d3a90f2d981da09b21640
Log:
Reduce struct size, on 64-bit by 8 bytes each
Note, the max modifiable flag value is currently 1<<5, there is still
some space. ATM it looks unlikely, but should more flags need to be
added, the types will need to be reconsidered.
Changed paths:
M Zend/zend_ini.h
Diff:
diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h
index 41d38ad..7c4fa39 100644
--- a/Zend/zend_ini.h
+++ b/Zend/zend_ini.h
@@ -38,10 +38,10 @@ typedef struct _zend_ini_entry_def {
void *mh_arg3;
const char *value;
void (*displayer)(zend_ini_entry *ini_entry, int type);
- int modifiable;
- uint32_t name_length;
uint32_t value_length;
+ uint16_t name_length;
+ uint8_t modifiable;
} zend_ini_entry_def;
struct _zend_ini_entry {
@@ -53,11 +53,13 @@ struct _zend_ini_entry {
zend_string *value;
zend_string *orig_value;
void (*displayer)(zend_ini_entry *ini_entry, int type);
- int modifiable;
- int orig_modifiable;
- int modified;
int module_number;
+
+ uint8_t modifiable;
+ uint8_t orig_modifiable;
+ uint8_t modified;
+
};
BEGIN_EXTERN_C()
@@ -97,7 +99,7 @@ END_EXTERN_C()
#define ZEND_INI_END() { NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0} };
#define ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, displayer)
\
- { name, on_modify, arg1, arg2, arg3, default_value, displayer, modifiable, sizeof(name)-1,
sizeof(default_value)-1 },
+ { name, on_modify, arg1, arg2, arg3, default_value, displayer, sizeof(default_value)-1,
sizeof(name)-1, modifiable },
#define ZEND_INI_ENTRY3(name, default_value, modifiable, on_modify, arg1, arg2, arg3) \
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, NULL)