From 305e250be76ca7dfa57d0d56c3f72977881f7dec Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Thu, 3 Oct 2024 16:18:49 -0400 Subject: [PATCH 1/3] Add known issue for pointer types using too much indirection --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d295046..6d427a2 100644 --- a/README.md +++ b/README.md @@ -1127,9 +1127,10 @@ The project author is aware of these issues and plans to fix them in a future release: - When generating docs with codox in a library that depends on coffi, the below error will be produced. A temporary workaround is to add an explicit dependency in your codox build on insn at version 0.2.1 -``` clojure -Unable to find static field: ACC_OPEN in interface org.objectweb.asm.Opcodes -``` + ``` + Unable to find static field: ACC_OPEN in interface org.objectweb.asm.Opcodes + ``` +- Pointer wrapper types like `[::mem/pointer ::mem/int]` currently use one too many layers of indirection. This is fixed on develop. ## Future Plans These features are planned for future releases. From ab0af5b0caa1a8688399b018484fdc0a3a8abb24 Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Thu, 3 Oct 2024 17:31:18 -0400 Subject: [PATCH 2/3] Remove extraneous use of address-of --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d427a2..d419d73 100644 --- a/README.md +++ b/README.md @@ -649,7 +649,7 @@ floats, the following code might be used. ;; float *out_floats; ;; int num_floats = returns_float_array(&out_floats); (let [out-floats (mem/alloc mem/pointer-size arena) - num-floats (returns-float-array* (mem/address-of out-floats)) + num-floats (returns-float-array* out-floats) floats-addr (mem/read-address out-floats) floats-slice (mem/slice-global floats-addr (unchecked-multiply-int mem/float-size num-floats))] ;; Using a try/finally to perform an operation when the stack frame exits, From 9af8cb0b47f77b6447d043f11589be04c0b9d583 Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Thu, 3 Oct 2024 17:32:41 -0400 Subject: [PATCH 3/3] Use reinterpret, not slice-global --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d419d73..8e19fc6 100644 --- a/README.md +++ b/README.md @@ -651,7 +651,7 @@ floats, the following code might be used. (let [out-floats (mem/alloc mem/pointer-size arena) num-floats (returns-float-array* out-floats) floats-addr (mem/read-address out-floats) - floats-slice (mem/slice-global floats-addr (unchecked-multiply-int mem/float-size num-floats))] + floats-slice (mem/reinterpret floats-addr (unchecked-multiply-int mem/float-size num-floats))] ;; Using a try/finally to perform an operation when the stack frame exits, ;; but not to try to catch anything. (try