diff options
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/tlperl/lib/CORE/vmem.h')
-rw-r--r-- | systems/texlive/tlnet/tlpkg/tlperl/lib/CORE/vmem.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/CORE/vmem.h b/systems/texlive/tlnet/tlpkg/tlperl/lib/CORE/vmem.h index bd765f68e2..c425ae187a 100644 --- a/systems/texlive/tlnet/tlpkg/tlperl/lib/CORE/vmem.h +++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/CORE/vmem.h @@ -64,19 +64,37 @@ inline void MEMODSlx(char *str, long x) /* * Pass all memory requests through to the compiler's msvcr*.dll. - * Optionaly track by using a doubly linked header. + * Optionally track by using a doubly linked header. */ #ifdef _USE_LINKED_LIST 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 + */ + +#if defined(__MINGW64__) && __GNUC__ > 11 +typedef struct _MemoryBlockHeader* PMEMORY_BLOCK_HEADER __attribute__ ((aligned(16))); +#else typedef struct _MemoryBlockHeader* PMEMORY_BLOCK_HEADER; +#endif + typedef struct _MemoryBlockHeader { PMEMORY_BLOCK_HEADER pNext; PMEMORY_BLOCK_HEADER pPrev; VMem *owner; + +#if defined(__MINGW64__) && __GNUC__ > 11 +} MEMORY_BLOCK_HEADER __attribute__ ((aligned(16))), *PMEMORY_BLOCK_HEADER; +#else } MEMORY_BLOCK_HEADER, *PMEMORY_BLOCK_HEADER; #endif +#endif + class VMem { public: |