Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 95c9b7e93b37d874a0f6f2a3c25fbe1121199124
      
https://github.com/Perl/perl5/commit/95c9b7e93b37d874a0f6f2a3c25fbe1121199124
  Author: Tony Cook <t...@develop-help.com>
  Date:   2020-07-30 (Thu, 30 Jul 2020)

  Changed paths:
    M op.h

  Log Message:
  -----------
  Revert "op.h: Add additional padding to struct opslab to ensure proper 
alignment"

This reverts commit a760468c9355bafaee57e94f13705c0ea925d9ca.

This change is fragile, the next change avoids the need for such
manual padding.


  Commit: f0cfed98a12d7c2954864f82237387d2b85de5c5
      
https://github.com/Perl/perl5/commit/f0cfed98a12d7c2954864f82237387d2b85de5c5
  Author: Tony Cook <t...@develop-help.com>
  Date:   2020-07-30 (Thu, 30 Jul 2020)

  Changed paths:
    M op.c
    M op.h

  Log Message:
  -----------
  re-work opslab handling to avoid non-portable alignment assumptions

Fixes #17871

The op slab allocator code made the assumption that since OP and
hence OPSLOT contain pointers, the base of each of those would be
an integral number of sizeof(pointer) (pointer units) from the
beginning of OPSLAB.

This assumption is non-portable, and broke calculating the location
of the slab based on the address of the op slot and the op slot offset
on m68k platforms.

To avoid that, this change now stores the opslot_offset as the
offset in pointer units from the beginning of opslab_slots rather
than from the beginning of the slab.

If alignment on a pointer boundary for OPs is required, the compiler
will align opslab_opslots and since we work in pointer units from there,
any allocated op slots will also be aligned.

If we assume PADOFFSET is no larger than a pointer and requires no
stricter alignment and structures in themselves have no stricter
alignment requirements then since we work in pointer units all core
OP structures should have sufficient alignment (if this isn't true,
then it's not a new problem, and not the problem I'm trying to solve
here.)

I haven't been able to test this on m68k hardware (the emulator I
tried to use can't maintain a network connection.)


Compare: https://github.com/Perl/perl5/compare/22ca1a825f43...f0cfed98a12d

Reply via email to