From adb7ba663348ba81c3e829d5cd2b20ca13cd9bec Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Mon, 23 Mar 2026 13:36:58 -0500 Subject: [PATCH] Remove pointer-shift on macos aarch64 macos actually works with 47-bit pointers. --- .github/workflows/test.yml | 2 +- src/include/janet.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8e2be6ad..3c63f0a1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest, macos-latest, macos-14, macos-15-intel ] + os: [ ubuntu-latest, ubuntu-24.04-latest, macos-latest, macos-14, macos-15-intel ] steps: - name: Checkout the repository uses: actions/checkout@master diff --git a/src/include/janet.h b/src/include/janet.h index 3ec4f423..eb356024 100644 --- a/src/include/janet.h +++ b/src/include/janet.h @@ -322,8 +322,9 @@ extern "C" { * This is needed to use nanboxing on systems with larger than 47-bit address spaces, such as many * aarch64 systems. */ #ifndef JANET_NANBOX_64_POINTER_SHIFT -#if defined(_M_ARM64) || defined(__aarch64__) -/* All pointers, including function pointers, should be 4-byte aligned on aarch64 by default */ +#if (defined(_M_ARM64) || defined(__aarch64__)) && !defined(JANET_APPLE) +/* All pointers, including function pointers, should be 4-byte aligned on aarch64 by default. + * The exception is aarch64 macos, as it uses the same 47-bit userland address-space as on amd64. */ #define JANET_NANBOX_64_POINTER_SHIFT 2 #endif #endif