Skip to content

Commit

Permalink
[Win32] Remove obsolete code from perl.h.
Browse files Browse the repository at this point in the history
Remove a Win32-specific memory alignment instruction as
discussed in Perl#22577.
  • Loading branch information
sisyphus authored and khwilliamson committed Sep 30, 2024
1 parent eee5649 commit 045b0df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
17 changes: 1 addition & 16 deletions perl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2560,22 +2560,7 @@ You probably want to be using L<C</INT2PTR>> instead.
# endif
#endif

/* On MS Windows,with 64-bit mingw-w64 compilers, we
need to attend to a __float128 alignment issue if
USE_QUADMATH is defined. Otherwise we simply:
typedef NVTYPE NV
32-bit mingw.org compilers might also require
aligned(32) - at least that's what I found with my
Math::Foat128 module. But this is as yet untested
here, so no allowance is being made for mingw.org
compilers at this stage. -- sisyphus January 2021
*/
#if (defined(USE_LONG_DOUBLE) || defined(USE_QUADMATH)) && defined(__MINGW64__)
/* 64-bit build, mingw-w64 compiler only */
typedef NVTYPE NV __attribute__ ((aligned(8)));
#else
typedef NVTYPE NV;
#endif
typedef NVTYPE NV;

#ifdef I_IEEEFP
# include <ieeefp.h>
Expand Down
12 changes: 7 additions & 5 deletions win32/vmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@ inline void MEMODSlx(char *str, long x)
class VMem;

/*
* Address an alignment issue with x64 mingw-w64 ports of gcc-12 and
* (presumably) later. We do the same thing again 16 lines further down.
* See https://github.com/Perl/perl5/issues/19824
* Address an alignment issue with x64 mingw-w64 ports of gcc.
* (We do the same thing again a little further down.)
* See https://github.com/Perl/perl5/issues/19824.
* Later modified as a result of discussions in
* https://github.com/Perl/perl5/issues/22577
*/

#if defined(__MINGW64__) && __GNUC__ > 11
#if defined(__MINGW64__)
typedef struct _MemoryBlockHeader* PMEMORY_BLOCK_HEADER __attribute__ ((aligned(16)));
#else
typedef struct _MemoryBlockHeader* PMEMORY_BLOCK_HEADER;
Expand All @@ -87,7 +89,7 @@ typedef struct _MemoryBlockHeader {
PMEMORY_BLOCK_HEADER pPrev;
VMem *owner;

#if defined(__MINGW64__) && __GNUC__ > 11
#if defined(__MINGW64__)
} MEMORY_BLOCK_HEADER __attribute__ ((aligned(16))), *PMEMORY_BLOCK_HEADER;
#else
} MEMORY_BLOCK_HEADER, *PMEMORY_BLOCK_HEADER;
Expand Down

0 comments on commit 045b0df

Please sign in to comment.