Skip to content

Conversation

@richardleach
Copy link
Contributor

The pahole tool, on AMD64, shows that this commit converts:

struct Perl_OpDumpContext {
        I32                        level;                /*     0     4 */

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

        UV                         bar;                  /*     8     8 */
        PerlIO *                   file;                 /*    16     8 */
        _Bool                      indent_needed;        /*    24     1 */

        /* size: 32, cachelines: 1, members: 4 */
        /* sum members: 21, holes: 1, sum holes: 4 */
        /* padding: 7 */
        /* last cacheline: 32 bytes */
};

to

struct Perl_OpDumpContext {
        PerlIO *                   file;                 /*     0     8 */
        UV                         bar;                  /*     8     8 */
        I32                        level;                /*    16     4 */
        _Bool                      indent_needed;        /*    20     1 */

        /* size: 24, cachelines: 1, members: 4 */
        /* padding: 3 */
        /* last cacheline: 24 bytes */
};

  • This set of changes does not require a perldelta entry.

@leonerd
Copy link
Contributor

leonerd commented Feb 7, 2026

Fails for g++:

dump.c:1875:13: error: designator order for field ‘Perl_OpDumpContext::bar’ does not match declaration order in ‘Perl_OpDumpContext’

It seems in C++, the order of the named initialisers has to match the order of the fields in the definition. Which seems suuuuuper-annoying as surely the entire point of named initialisers is to remove that interdependence.. Grr. :(

The pahole tool, on AMD64, shows that this commit converts:
```
struct Perl_OpDumpContext {
        I32                        level;                /*     0     4 */

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

        UV                         bar;                  /*     8     8 */
        PerlIO *                   file;                 /*    16     8 */
        _Bool                      indent_needed;        /*    24     1 */

        /* size: 32, cachelines: 1, members: 4 */
        /* sum members: 21, holes: 1, sum holes: 4 */
        /* padding: 7 */
        /* last cacheline: 32 bytes */
};
```

to

```
struct Perl_OpDumpContext {
        PerlIO *                   file;                 /*     0     8 */
        UV                         bar;                  /*     8     8 */
        I32                        level;                /*    16     4 */
        _Bool                      indent_needed;        /*    20     1 */

        /* size: 24, cachelines: 1, members: 4 */
        /* padding: 3 */
        /* last cacheline: 24 bytes */
};
```
@richardleach richardleach force-pushed the Perl_OpDumpContext-4bytehole branch from 2b54fe4 to 4f8bb1b Compare February 8, 2026 12:07
@richardleach
Copy link
Contributor Author

That is maddening. I've reordered the initialiser fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants