Add align-of
This commit is contained in:
parent
1b8923bc33
commit
579393f830
1 changed files with 5 additions and 0 deletions
|
|
@ -349,6 +349,11 @@
|
||||||
[type]
|
[type]
|
||||||
(.byteSize ^MemoryLayout (c-layout 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
|
(defn alloc-instance
|
||||||
"Allocates a memory segment for the given `type`."
|
"Allocates a memory segment for the given `type`."
|
||||||
([type] (alloc-instance type (connected-scope)))
|
([type] (alloc-instance type (connected-scope)))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue