From 579393f830c349a4857c40dbfbcdbbfee63d7528 Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Mon, 10 Jan 2022 13:30:01 -0600 Subject: [PATCH] Add align-of --- src/clj/coffi/mem.clj | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/clj/coffi/mem.clj b/src/clj/coffi/mem.clj index b003216..5095a59 100644 --- a/src/clj/coffi/mem.clj +++ b/src/clj/coffi/mem.clj @@ -349,6 +349,11 @@ [type] (.byteSize ^MemoryLayout (c-layout type))) +(defn align-of + "The alignment in bytes of the given `type`." + [type] + (.byteAlignment ^MemoryLayout (c-layout type))) + (defn alloc-instance "Allocates a memory segment for the given `type`." ([type] (alloc-instance type (connected-scope)))