From 990e76c624a4a2b2d4f10b864c92c9c15b2500d5 Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Mon, 31 Oct 2022 11:36:16 -0500 Subject: [PATCH] Fix incorrect pointer alignment --- CHANGELOG.md | 3 +++ src/clj/coffi/mem.clj | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3042ed4..2694a21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ All notable changes to this project will be documented in this file. This change - New macros for defining vars with values from native code - New function to allow getting the backing memory segment of a `coffi.ffi.StaticVariable`, to replace the `Addressable` implementation lost in the migration to JDK 18 +### Fixed +- Bug where pointer alignment was incorrectly defined + ## [0.5.357] - 2022-07-07 ### Removed - `:coffi.mem/long-long` primitive type diff --git a/src/clj/coffi/mem.clj b/src/clj/coffi/mem.clj index c4642c1..38135ad 100644 --- a/src/clj/coffi/mem.clj +++ b/src/clj/coffi/mem.clj @@ -236,7 +236,7 @@ (def ^ValueLayout$OfAddress pointer-layout "The [[MemoryLayout]] for a native pointer in [[native-endian]] [[ByteOrder]]." - ValueLayout/ADDRESS) + (MemoryLayout/valueLayout MemoryAddress native-endian)) (def ^long short-size "The size in bytes of a c-sized short."