com php-src: Put phpinfo() related code into cold code segment: Zend/zend_API.h ext/standard/credits.c ext/standard/c ss.c ext/standard/info.c
main/php_ini.c

From: Date: Tue, 28 May 2019 08:04:13 +0000
Subject: com php-src: Put phpinfo() related code into cold code segment: Zend/zend_API.h ext/standard/credits.c ext/standard/c ss.c ext/standard/info.c
main/php_ini.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-106379@lists.php.net to get a copy of this message
Commit: 072f28938f1c8860432c22c03ce7bdc7e8112e61 Author: Dmitry Stogov <dmitry@zend.com> Tue, 28 May 2019 11:04:13 +0300 Parents: 2c6bc99019a0e2636d1c22350a47d61d4b5b2454 Branches: PHP-7.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=072f28938f1c8860432c22c03ce7bdc7e8112e61 Log: Put phpinfo() related code into cold code segment Changed paths: M Zend/zend_API.h M ext/standard/credits.c M ext/standard/css.c M ext/standard/info.c M main/php_ini.c

diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 577feb0..1ed6110 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -140,7 +140,7 @@ typedef struct _zend_fcall_info_cache { #define ZEND_MODULE_ACTIVATE_D(module) int ZEND_MODULE_ACTIVATE_N(module)(INIT_FUNC_ARGS) #define ZEND_MODULE_DEACTIVATE_D(module) int ZEND_MODULE_DEACTIVATE_N(module)(SHUTDOWN_FUNC_ARGS) #define ZEND_MODULE_POST_ZEND_DEACTIVATE_D(module) int ZEND_MODULE_POST_ZEND_DEACTIVATE_N(module)(void) -#define ZEND_MODULE_INFO_D(module) void ZEND_MODULE_INFO_N(module)(ZEND_MODULE_INFO_FUNC_ARGS) +#define ZEND_MODULE_INFO_D(module) ZEND_COLD void ZEND_MODULE_INFO_N(module)(ZEND_MODULE_INFO_FUNC_ARGS) #define ZEND_MODULE_GLOBALS_CTOR_D(module) void ZEND_MODULE_GLOBALS_CTOR_N(module)(zend_##module##_globals *module##_globals) #define ZEND_MODULE_GLOBALS_DTOR_D(module) void ZEND_MODULE_GLOBALS_DTOR_N(module)(zend_##module##_globals *module##_globals) diff --git a/ext/standard/credits.c b/ext/standard/credits.c index 0e56258..556ffd7 100644 --- a/ext/standard/credits.c +++ b/ext/standard/credits.c @@ -23,7 +23,7 @@ #define CREDIT_LINE(module, authors) php_info_print_table_row(2, module, authors) -PHPAPI void php_print_credits(int flag) /* {{{ */ +PHPAPI ZEND_COLD void php_print_credits(int flag) /* {{{ */ { if (!sapi_module.phpinfo_as_text && flag & PHP_CREDITS_FULLPAGE) { php_print_info_htmlhead(); diff --git a/ext/standard/css.c b/ext/standard/css.c index ac1e2cf..0e4afd9 100644 --- a/ext/standard/css.c +++ b/ext/standard/css.c @@ -19,7 +19,7 @@ #include "php.h" #include "info.h" -PHPAPI void php_info_print_css(void) /* {{{ */ +PHPAPI ZEND_COLD void php_info_print_css(void) /* {{{ */ { PUTS("body {background-color: #fff; color: #222; font-family: sans-serif;}\n"); PUTS("pre {margin: 0; font-family: monospace;}\n"); diff --git a/ext/standard/info.c b/ext/standard/info.c index 4600d66..1e58b31 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -54,7 +54,7 @@ PHPAPI extern char *php_ini_opened_path; PHPAPI extern char *php_ini_scanned_path; PHPAPI extern char *php_ini_scanned_files; -static int php_info_print_html_esc(const char *str, size_t len) /* {{{ */ +static ZEND_COLD int php_info_print_html_esc(const char *str, size_t len) /* {{{ */ { size_t written; zend_string *new_str; @@ -66,7 +66,7 @@ static int php_info_print_html_esc(const char *str, size_t len) /* {{{ */ } /* }}} */ -static int php_info_printf(const char *fmt, ...) /* {{{ */ +static ZEND_COLD int php_info_printf(const char *fmt, ...) /* {{{ */ { char *buf; size_t len, written; @@ -82,13 +82,13 @@ static int php_info_printf(const char *fmt, ...) /* {{{ */ } /* }}} */ -static int php_info_print(const char *str) /* {{{ */ +static zend_always_inline int php_info_print(const char *str) /* {{{ */ { return php_output_write(str, strlen(str)); } /* }}} */ -static void php_info_print_stream_hash(const char *name, HashTable *ht) /* {{{ */ +static ZEND_COLD void php_info_print_stream_hash(const char *name, HashTable *ht) /* {{{ */ { zend_string *key; @@ -131,7 +131,7 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht) /* {{{ * } /* }}} */ -PHPAPI void php_info_print_module(zend_module_entry *zend_module) /* {{{ */ +PHPAPI ZEND_COLD void php_info_print_module(zend_module_entry *zend_module) /* {{{ */ { if (zend_module->info_func || zend_module->version) { if (!sapi_module.phpinfo_as_text) { @@ -166,7 +166,7 @@ PHPAPI void php_info_print_module(zend_module_entry *zend_module) /* {{{ */ /* {{{ php_print_gpcse_array */ -static void php_print_gpcse_array(char *name, uint32_t name_length) +static ZEND_COLD void php_print_gpcse_array(char *name, uint32_t name_length) { zval *data, *tmp; zend_string *string_key; @@ -241,7 +241,7 @@ static void php_print_gpcse_array(char *name, uint32_t name_length) /* {{{ php_info_print_style */ -void php_info_print_style(void) +PHPAPI ZEND_COLD void ZEND_COLD php_info_print_style(void) { php_info_printf("<style type=\"text/css\">\n"); php_info_print_css(); @@ -251,7 +251,7 @@ void php_info_print_style(void) /* {{{ php_info_html_esc */ -PHPAPI zend_string *php_info_html_esc(char *string) +PHPAPI ZEND_COLD zend_string *php_info_html_esc(char *string) { return php_escape_html_entities((unsigned char *) string, strlen(string), 0, ENT_QUOTES, NULL); } @@ -732,7 +732,7 @@ PHPAPI zend_string *php_get_uname(char mode) /* {{{ php_print_info_htmlhead */ -PHPAPI void php_print_info_htmlhead(void) +PHPAPI ZEND_COLD void php_print_info_htmlhead(void) { php_info_print("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n"); php_info_print("<html xmlns=\"http://www.w3.org/1999/xhtml\">"); @@ -758,7 +758,7 @@ static int module_name_cmp(const void *a, const void *b) /* {{{ php_print_info */ -PHPAPI void php_print_info(int flag) +PHPAPI ZEND_COLD void php_print_info(int flag) { char **env, *tmp1, *tmp2; zend_string *php_uname; @@ -1045,7 +1045,7 @@ PHPAPI void php_print_info(int flag) } /* }}} */ -PHPAPI void php_info_print_table_start(void) /* {{{ */ +PHPAPI ZEND_COLD void php_info_print_table_start(void) /* {{{ */ { if (!sapi_module.phpinfo_as_text) { php_info_print("<table>\n"); @@ -1055,7 +1055,7 @@ PHPAPI void php_info_print_table_start(void) /* {{{ */ } /* }}} */ -PHPAPI void php_info_print_table_end(void) /* {{{ */ +PHPAPI ZEND_COLD void php_info_print_table_end(void) /* {{{ */ { if (!sapi_module.phpinfo_as_text) { php_info_print("</table>\n"); @@ -1064,7 +1064,7 @@ PHPAPI void php_info_print_table_end(void) /* {{{ */ } /* }}} */ -PHPAPI void php_info_print_box_start(int flag) /* {{{ */ +PHPAPI ZEND_COLD void php_info_print_box_start(int flag) /* {{{ */ { php_info_print_table_start(); if (flag) { @@ -1081,7 +1081,7 @@ PHPAPI void php_info_print_box_start(int flag) /* {{{ */ } /* }}} */ -PHPAPI void php_info_print_box_end(void) /* {{{ */ +PHPAPI ZEND_COLD void php_info_print_box_end(void) /* {{{ */ { if (!sapi_module.phpinfo_as_text) { php_info_print("</td></tr>\n"); @@ -1090,7 +1090,7 @@ PHPAPI void php_info_print_box_end(void) /* {{{ */ } /* }}} */ -PHPAPI void php_info_print_hr(void) /* {{{ */ +PHPAPI ZEND_COLD void php_info_print_hr(void) /* {{{ */ { if (!sapi_module.phpinfo_as_text) { php_info_print("<hr />\n"); @@ -1100,7 +1100,7 @@ PHPAPI void php_info_print_hr(void) /* {{{ */ } /* }}} */ -PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header) /* {{{ */ +PHPAPI ZEND_COLD void php_info_print_table_colspan_header(int num_cols, char *header) /* {{{ */ { int spaces; @@ -1115,7 +1115,7 @@ PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header) /* { /* {{{ php_info_print_table_header */ -PHPAPI void php_info_print_table_header(int num_cols, ...) +PHPAPI ZEND_COLD void php_info_print_table_header(int num_cols, ...) { int i; va_list row_elements; @@ -1153,7 +1153,7 @@ PHPAPI void php_info_print_table_header(int num_cols, ...) /* {{{ php_info_print_table_row_internal */ -static void php_info_print_table_row_internal(int num_cols, +static ZEND_COLD void php_info_print_table_row_internal(int num_cols, const char *value_class, va_list row_elements) { int i; @@ -1199,7 +1199,7 @@ static void php_info_print_table_row_internal(int num_cols, /* {{{ php_info_print_table_row */ -PHPAPI void php_info_print_table_row(int num_cols, ...) +PHPAPI ZEND_COLD void php_info_print_table_row(int num_cols, ...) { va_list row_elements; @@ -1211,7 +1211,7 @@ PHPAPI void php_info_print_table_row(int num_cols, ...) /* {{{ php_info_print_table_row_ex */ -PHPAPI void php_info_print_table_row_ex(int num_cols, const char *value_class, +PHPAPI ZEND_COLD void php_info_print_table_row_ex(int num_cols, const char *value_class, ...) { va_list row_elements; diff --git a/main/php_ini.c b/main/php_ini.c index d688323..f6c2edf 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -69,7 +69,7 @@ PHPAPI char *php_ini_scanned_files=NULL; /* {{{ php_ini_displayer_cb */ -static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type) +static ZEND_COLD void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type) { if (ini_entry->displayer) { ini_entry->displayer(ini_entry, type); @@ -117,7 +117,7 @@ static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type) /* {{{ display_ini_entries */ -PHPAPI void display_ini_entries(zend_module_entry *module) +PHPAPI ZEND_COLD void display_ini_entries(zend_module_entry *module) { int module_number; zend_ini_entry *ini_entry;
« previous php.cvs (#106379) next »