Skip to content

Align structures for 64bit platforms for improve putting to CPU cacheline #18559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Zend/zend_property_hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

typedef struct {
zend_object_iterator it;
zval declared_props;
bool by_ref;
bool declared_props_done;
zval declared_props;
bool dynamic_props_done;
uint32_t dynamic_prop_offset;
uint32_t dynamic_prop_it;
Expand Down
2 changes: 1 addition & 1 deletion ext/dom/lexbor/lexbor/css/property.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ typedef struct {
lxb_css_property_float_reference_t;

typedef struct {
lxb_css_float_type_t type;
lxb_css_value_length_type_t length;
lxb_css_float_type_t type;
Comment on lines -231 to +232
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, don't change the bundled third-party libraries without a big reason.

lxb_css_float_type_t snap_type;
}
lxb_css_property_float_t;
Expand Down
2 changes: 1 addition & 1 deletion ext/dom/lexbor/lexbor/css/selectors/pseudo.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ typedef struct {
lxb_char_t *name;
size_t length;
unsigned id;
bool empty;
lxb_css_selector_combinator_t combinator;
const lxb_css_syntax_cb_function_t cb;
bool empty;
bool forgiving;
bool comma;
}
Expand Down
60 changes: 30 additions & 30 deletions ext/dom/lexbor/lexbor/css/selectors/pseudo_res.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,61 +67,61 @@ static const lxb_css_selectors_pseudo_data_t lxb_css_selectors_pseudo_data_pseud
static const lxb_css_selectors_pseudo_data_func_t lxb_css_selectors_pseudo_data_pseudo_class_function[LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION__LAST_ENTRY] =
{
{(lxb_char_t *) "#undef", 6, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION__UNDEF,
false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
{.state = lxb_css_selectors_state_pseudo_class_function__undef, .block = NULL,
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false},
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false, false},
{(lxb_char_t *) "current", 7, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_CURRENT,
false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
{.state = lxb_css_selectors_state_pseudo_class_function_current, .block = NULL,
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, true},
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false, true},
{(lxb_char_t *) "dir", 3, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_DIR,
false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
{.state = lxb_css_selectors_state_pseudo_class_function_dir, .block = NULL,
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false},
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false, false},
{(lxb_char_t *) "has", 3, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_HAS,
false, LXB_CSS_SELECTOR_COMBINATOR_DESCENDANT,
LXB_CSS_SELECTOR_COMBINATOR_DESCENDANT,
{.state = lxb_css_selectors_state_pseudo_class_function_has, .block = NULL,
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_forgiving_relative}, true, true},
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_forgiving_relative}, false, true, true},
{(lxb_char_t *) "is", 2, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_IS,
false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
{.state = lxb_css_selectors_state_pseudo_class_function_is, .block = NULL,
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_forgiving}, true, true},
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_forgiving}, false, true, true},
{(lxb_char_t *) "lang", 4, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_LANG,
false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
{.state = lxb_css_selectors_state_pseudo_class_function_lang, .block = NULL,
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false},
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false, false},
{(lxb_char_t *) "not", 3, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NOT,
false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
{.state = lxb_css_selectors_state_pseudo_class_function_not, .block = NULL,
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, true},
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false, true},
{(lxb_char_t *) "nth-child", 9, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_CHILD,
false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
{.state = lxb_css_selectors_state_pseudo_class_function_nth_child, .block = NULL,
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, true},
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false, true},
{(lxb_char_t *) "nth-col", 7, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_COL,
false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
{.state = lxb_css_selectors_state_pseudo_class_function_nth_col, .block = NULL,
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false},
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false, false},
{(lxb_char_t *) "nth-last-child", 14, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_CHILD,
false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
{.state = lxb_css_selectors_state_pseudo_class_function_nth_last_child, .block = NULL,
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, true},
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false, true},
{(lxb_char_t *) "nth-last-col", 12, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_COL,
false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
{.state = lxb_css_selectors_state_pseudo_class_function_nth_last_col, .block = NULL,
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false},
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false, false},
{(lxb_char_t *) "nth-last-of-type", 16, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_LAST_OF_TYPE,
false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
{.state = lxb_css_selectors_state_pseudo_class_function_nth_last_of_type, .block = NULL,
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false},
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false, false},
{(lxb_char_t *) "nth-of-type", 11, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_NTH_OF_TYPE,
false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
{.state = lxb_css_selectors_state_pseudo_class_function_nth_of_type, .block = NULL,
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false},
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false, false},
{(lxb_char_t *) "where", 5, LXB_CSS_SELECTOR_PSEUDO_CLASS_FUNCTION_WHERE,
false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
{.state = lxb_css_selectors_state_pseudo_class_function_where, .block = NULL,
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_forgiving}, true, true}
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_forgiving}, false, true, true}
};

static const lxb_css_selectors_pseudo_data_t lxb_css_selectors_pseudo_data_pseudo_element[LXB_CSS_SELECTOR_PSEUDO_ELEMENT__LAST_ENTRY] =
Expand All @@ -144,9 +144,9 @@ static const lxb_css_selectors_pseudo_data_t lxb_css_selectors_pseudo_data_pseud
static const lxb_css_selectors_pseudo_data_func_t lxb_css_selectors_pseudo_data_pseudo_element_function[LXB_CSS_SELECTOR_PSEUDO_ELEMENT_FUNCTION__LAST_ENTRY] =
{
{(lxb_char_t *) "#undef", 6, LXB_CSS_SELECTOR_PSEUDO_ELEMENT_FUNCTION__UNDEF,
false, LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
LXB_CSS_SELECTOR_COMBINATOR_CLOSE,
{.state = lxb_css_selectors_state_pseudo_element_function__undef, .block = NULL,
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false}
.failed = lxb_css_state_failed, .end = lxb_css_selectors_state_function_end}, false, false, false}
};

static const lexbor_shs_entry_t lxb_css_selectors_pseudo_class_shs[79] =
Expand Down
2 changes: 1 addition & 1 deletion ext/dom/lexbor/lexbor/css/syntax/token.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ struct lxb_css_syntax_token {
types;

lxb_css_syntax_token_type_t type;
uintptr_t offset;
bool cloned;
uintptr_t offset;
};


Expand Down
2 changes: 1 addition & 1 deletion ext/dom/lexbor/lexbor/encoding/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ lxb_encoding_ctx_euc_jp_t;
typedef struct {
lxb_char_t lead;
lxb_char_t prepand;
bool out_flag;
unsigned state;
unsigned out_state;
bool out_flag;
}
lxb_encoding_ctx_2022_jp_t;

Expand Down
2 changes: 1 addition & 1 deletion ext/fileinfo/libmagic/cdf.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ typedef struct {
cdf_dirid_t d_storage;
uint64_t d_storage_uuid[2];
uint32_t d_flags;
uint32_t d_size;
cdf_timestamp_t d_created;
cdf_timestamp_t d_modified;
cdf_secid_t d_stream_first_sector;
uint32_t d_size;
uint32_t d_unused0;
} cdf_directory_t;

Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/jit/ir/dynasm/minilua.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,12 @@ typedef struct Table{
GCObject*next;lu_byte tt;lu_byte marked;
lu_byte flags;
lu_byte lsizenode;
int sizearray;
struct Table*metatable;
TValue*array;
Node*node;
Node*lastfree;
GCObject*gclist;
int sizearray;
Comment on lines +360 to -365
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is also third-party software.

}Table;
#define lmod(s,size)(check_exp((size&(size-1))==0,(cast(int,(s)&((size)-1)))))
#define twoto(x)((size_t)1<<(x))
Expand Down
4 changes: 2 additions & 2 deletions ext/opcache/zend_shared_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ typedef struct _zend_smm_shared_globals {
zend_shared_segment **shared_segments;
/* Number of allocated shared segments */
int shared_segments_count;
/* No more shared memory flag */
bool memory_exhausted;
/* Amount of free shared memory */
size_t shared_free;
/* Amount of shared memory allocated by garbage */
size_t wasted_shared_memory;
/* No more shared memory flag */
bool memory_exhausted;
/* Saved Shared Allocator State */
zend_shared_memory_state shared_memory_state;
/* Pointer to the application's shared data structures */
Expand Down
2 changes: 1 addition & 1 deletion main/php_network.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ END_EXTERN_C()
struct _php_netstream_data_t {
php_socket_t socket;
char is_blocked;
struct timeval timeout;
char timeout_event;
struct timeval timeout;
size_t ownsize;
};
typedef struct _php_netstream_data_t php_netstream_data_t;
Expand Down
4 changes: 2 additions & 2 deletions main/streams/glob_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
typedef struct {
glob_t glob;
size_t index;
int flags;
char *path;
size_t path_len;
char *pattern;
size_t pattern_len;
int flags;
bool open_basedir_used;
size_t *open_basedir_indexmap;
size_t open_basedir_indexmap_size;
bool open_basedir_used;
} glob_s_t;

PHPAPI char* _php_glob_stream_get_path(php_stream *stream, size_t *plen STREAMS_DC) /* {{{ */
Expand Down
2 changes: 1 addition & 1 deletion sapi/phpdbg/phpdbg.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ ZEND_BEGIN_MODULE_GLOBALS(phpdbg)
bool active;
int type;
int fd;
char *msg;
int msglen;
char *msg;
} err_buf; /* error buffer */
zend_ulong req_id; /* "request id" to keep track of commands */

Expand Down
6 changes: 3 additions & 3 deletions sapi/phpdbg/phpdbg_bp.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ typedef struct _zend_op *phpdbg_opline_ptr_t; /* }}} */

/* {{{ breakpoint base structure */
#define phpdbg_breakbase(name) \
int id; \
uint8_t type; \
zend_ulong hits; \
bool disabled; \
int id; \
zend_ulong hits; \
const char *name /* }}} */

/* {{{ breakpoint base */
Expand Down Expand Up @@ -107,9 +107,9 @@ typedef struct _phpdbg_breakop_t {
* Breakpoint condition based representation
*/
typedef struct _phpdbg_breakcond_t {
bool paramed;
phpdbg_breakbase(code);
size_t code_len;
bool paramed;
phpdbg_param_t param;
zend_ulong hash;
zend_op_array *ops;
Expand Down
8 changes: 4 additions & 4 deletions sapi/phpdbg/phpdbg_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ struct _phpdbg_command_t {
const char *tip; /* Menu tip */
size_t tip_len; /* Menu tip length */
char alias; /* Alias */
bool flags; /* General flags */
phpdbg_command_handler_t handler; /* Command handler */
const phpdbg_command_t *subs; /* Sub Commands */
char *args; /* Argument Spec */
const phpdbg_command_t *parent; /* Parent Command */
bool flags; /* General flags */
};
/* }}} */

Expand Down Expand Up @@ -156,13 +156,13 @@ PHPDBG_API void phpdbg_param_debug(const phpdbg_param_t *param, const char *msg)
#define PHPDBG_COMMAND_HANDLER(name) phpdbg_do_##name

#define PHPDBG_COMMAND_D_EXP(name, tip, alias, handler, children, args, parent, flags) \
{PHPDBG_STRL(#name), tip, sizeof(tip)-1, alias, phpdbg_do_##handler, children, args, parent, flags}
{PHPDBG_STRL(#name), tip, sizeof(tip)-1, flags, alias, phpdbg_do_##handler, children, args, parent}

#define PHPDBG_COMMAND_D_EX(name, tip, alias, handler, children, args, flags) \
{PHPDBG_STRL(#name), tip, sizeof(tip)-1, alias, phpdbg_do_##handler, children, args, NULL, flags}
{PHPDBG_STRL(#name), tip, sizeof(tip)-1, flags, alias, phpdbg_do_##handler, children, args, NULL}

#define PHPDBG_COMMAND_D(name, tip, alias, children, args, flags) \
{PHPDBG_STRL(#name), tip, sizeof(tip)-1, alias, phpdbg_do_##name, children, args, NULL, flags}
{PHPDBG_STRL(#name), tip, sizeof(tip)-1, flags, alias, phpdbg_do_##name, children, args, NULL}

#define PHPDBG_COMMAND(name) int phpdbg_do_##name(const phpdbg_param_t *param)

Expand Down
2 changes: 1 addition & 1 deletion sapi/phpdbg/phpdbg_help.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg)

/* {{{ Commands Table */
#define PHPDBG_COMMAND_HELP_D(name, tip, alias, action) \
{PHPDBG_STRL(#name), tip, sizeof(tip)-1, alias, action, &phpdbg_prompt_commands[16], 0, NULL, (bool) 0}
{PHPDBG_STRL(#name), tip, sizeof(tip)-1, alias, (bool) 0, action, &phpdbg_prompt_commands[16], 0, NULL}

const phpdbg_command_t phpdbg_help_commands[] = {
PHPDBG_COMMAND_HELP_D(aliases, "show alias list", 'a', phpdbg_do_help_aliases),
Expand Down
2 changes: 1 addition & 1 deletion sapi/phpdbg/phpdbg_lexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@

typedef struct {
unsigned int len;
int state;
unsigned char *text;
unsigned char *cursor;
unsigned char *marker;
unsigned char *ctxmarker;
int state;
} phpdbg_lexer_data;

#define yyparse phpdbg_parse
Expand Down
Loading