Put phpinfo() related code into cold code segment

This commit is contained in:
Dmitry Stogov 2019-05-28 11:04:13 +03:00
parent 2c6bc99019
commit 072f28938f
5 changed files with 25 additions and 25 deletions

View File

@ -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)

View File

@ -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();

View File

@ -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");

View File

@ -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;

View File

@ -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;