Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Include/internal/pycore_backoff.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ extern "C" {
#include <stdint.h>


#ifdef _AIX
#pragma pack(push, 1)
#endif
typedef struct {
union {
struct {
Expand All @@ -23,6 +26,9 @@ typedef struct {
uint16_t as_counter; // For printf("%#x", ...)
};
} _Py_BackoffCounter;
#ifdef _AIX
#pragma pack(pop)
#endif


/* 16-bit countdown counters using exponential backoff.
Expand Down
6 changes: 6 additions & 0 deletions Include/internal/pycore_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ extern "C" {
* 2**32 - 1, rather than INT_MAX.
*/

#ifdef _AIX
#pragma pack(push, 1)
#endif
typedef union {
uint16_t cache;
struct {
Expand All @@ -29,6 +32,9 @@ typedef union {
} op;
_Py_BackoffCounter counter; // First cache entry of specializable op
} _Py_CODEUNIT;
#ifdef _AIX
#pragma pack(pop)
#endif

#define _PyCode_CODE(CO) _Py_RVALUE((_Py_CODEUNIT *)(CO)->co_code_adaptive)
#define _PyCode_NBYTES(CO) (Py_SIZE(CO) * (Py_ssize_t)sizeof(_Py_CODEUNIT))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix AIX build failures caused by incorrect struct alignment in ``_Py_CODEUNIT``
and ``_Py_BackoffCounter`` by adding AIX-specific ``#pragma pack`` directives.
Loading