Skip to content
Open
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: 5 additions & 1 deletion src/gapstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
#include <setjmp.h>

enum {
STATE_SLOTS_SIZE = 32768 - 1024,
// On some platforms (e.g., powerpc64), sizeof(jmp_buf) is much larger
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this Linux on powerpc64 or what?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's FreeBSD on powerpc64 / powerpc64le.

// than ~200 bytes on x86_64/aarch64. Subtract the excess so that
// GAPState stays within the 32767-byte 16-bit signed offset limit.
GAP_JMP_BUF_EXTRA = (int)sizeof(jmp_buf) > 200 ? (int)sizeof(jmp_buf) - 200 : 0,
STATE_SLOTS_SIZE = 32768 - 1024 - GAP_JMP_BUF_EXTRA,
};

typedef struct GAPState {
Expand Down
Loading