Skip to content

Commit

Permalink
Put phpinfo() related code into cold code segment
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed May 28, 2019
1 parent 2c6bc99 commit 072f289
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Zend/zend_API.h
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion ext/standard/credits.c
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/css.c
Expand Up @@ -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");
Expand Down
40 changes: 20 additions & 20 deletions ext/standard/info.c
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -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);
}
Expand Down Expand Up @@ -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\">");
Expand All @@ -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;
Expand Down Expand Up @@ -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");
Expand All @@ -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");
Expand All @@ -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) {
Expand All @@ -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");
Expand All @@ -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");
Expand All @@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions main/php_ini.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 072f289

Please sign in to comment.