From 072f28938f1c8860432c22c03ce7bdc7e8112e61 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 28 May 2019 11:04:13 +0300 Subject: [PATCH] Put phpinfo() related code into cold code segment --- Zend/zend_API.h | 2 +- ext/standard/credits.c | 2 +- ext/standard/css.c | 2 +- ext/standard/info.c | 40 ++++++++++++++++++++-------------------- main/php_ini.c | 4 ++-- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 577feb025d2..1ed6110991f 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 0e56258c35f..556ffd73ddb 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 ac1e2cf4bb7..0e4afd99077 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 4600d66d177..1e58b31a0fb 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("