Skip to content

Mysqli struct upd #19072

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 3 commits into
base: master
Choose a base branch
from
Open

Mysqli struct upd #19072

wants to merge 3 commits into from

Conversation

devnexen
Copy link
Member

@devnexen devnexen commented Jul 8, 2025

No description provided.

@devnexen
Copy link
Member Author

devnexen commented Jul 9, 2025

Before the change

struct _zend_mysqli_globals {
        zend_long                  num_links;            /*     0     8 */
        zend_long                  max_links;            /*     8     8 */
        zend_long                  num_active_persistent; /*    16     8 */
        zend_long                  num_inactive_persistent; /*    24     8 */
        zend_long                  max_persistent;       /*    32     8 */
        _Bool                      allow_persistent;     /*    40     1 */

        /* XXX 7 bytes hole, try to pack */

        zend_ulong                 default_port;         /*    48     8 */
        char *                     default_host;         /*    56     8 */
        /* --- cacheline 1 boundary (64 bytes) --- */
        char *                     default_user;         /*    64     8 */
        char *                     default_pw;           /*    72     8 */
        char *                     default_socket;       /*    80     8 */
        _Bool                      allow_local_infile;   /*    88     1 */

        /* XXX 7 bytes hole, try to pack */

        char *                     local_infile_directory; /*    96     8 */
        zend_long                  error_no;             /*   104     8 */
        char *                     error_msg;            /*   112     8 */
        zend_long                  report_mode;          /*   120     8 */
        /* --- cacheline 2 boundary (128 bytes) --- */
        _Bool                      rollback_on_cached_plink; /*   128     1 */

        /* size: 136, cachelines: 3, members: 17 */
        /* sum members: 115, holes: 2, sum holes: 14 */
        /* padding: 7 */
        /* last cacheline: 8 bytes */
};

after

struct _zend_mysqli_globals {
        unsigned short             default_port;         /*     0     2 */
        _Bool                      allow_persistent;     /*     2     1 */
        _Bool                      allow_local_infile;   /*     3     1 */

        /* XXX 4 bytes hole, try to pack */

        char *                     default_host;         /*     8     8 */
        char *                     default_user;         /*    16     8 */
        char *                     default_pw;           /*    24     8 */
        char *                     default_socket;       /*    32     8 */
        char *                     local_infile_directory; /*    40     8 */
        char *                     error_msg;            /*    48     8 */
        zend_long                  num_links;            /*    56     8 */
        /* --- cacheline 1 boundary (64 bytes) --- */
        zend_long                  max_links;            /*    64     8 */
        zend_long                  num_active_persistent; /*    72     8 */
        zend_long                  num_inactive_persistent; /*    80     8 */
        zend_long                  max_persistent;       /*    88     8 */
        zend_long                  error_no;             /*    96     8 */
        zend_long                  report_mode;          /*   104     8 */
        _Bool                      rollback_on_cached_plink; /*   112     1 */

        /* size: 120, cachelines: 2, members: 17 */
        /* sum members: 109, holes: 1, sum holes: 4 */
        /* padding: 7 */
        /* last cacheline: 56 bytes */
};

@devnexen devnexen marked this pull request as ready for review July 9, 2025 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant