Contains view
for creating a view over native memory (as opposed to the JVM heap)
as well as utilities for handling raw pointers.
The main utility is view
which returns a DirectByteBuffer
. Allocating native memory
can lead to performance increase and simplifies things when using tools such as JNI.
Other utilities are related to raw pointers and are DANGEROUS.
Manipulating raw pointers and managing memory is just as error prone as in native programming. Those utilities are for users knowing both what they want and what it implies. Otherwise, segfaults are to be expected.
<!> Pointer utilities are still experimental, might change in the future <!>
Contains [[view]] for creating a view over native memory (as opposed to the JVM heap) as well as utilities for handling raw pointers. The main utility is [[view]] which returns a `DirectByteBuffer`. Allocating native memory can lead to performance increase and simplifies things when using tools such as JNI. Other utilities are related to raw pointers and are DANGEROUS. Manipulating raw pointers and managing memory is just as error prone as in native programming. Those utilities are for users knowing both what they want and what it implies. Otherwise, segfaults are to be expected. <!> Pointer utilities are still experimental, might change in the future <!>
(alloc n-byte)
Returns a raw pointer after allocating n-byte
bytes in native memory.
Returns a raw pointer after allocating `n-byte` bytes in native memory.
(copy ptr-dest ptr-src n-byte)
Copies n-byte
bytes from a raw pointer to another raw pointer.
Copies `n-byte` bytes from a raw pointer to another raw pointer.
Number of bytes in a pointer on this machine.
Should be 4 on a 32-bit machine, 8 on a 64-bit machine.
Number of bytes in a pointer on this machine. Should be 4 on a 32-bit machine, 8 on a 64-bit machine.
(r-b64 ptr)
Dereferences a raw pointer to a 64-bit integer.
Meant to be used with the helins.binf.int64
namespace.
Dereferences a raw pointer to a 64-bit integer. Meant to be used with the `helins.binf.int64` namespace.
(r-f32 ptr)
Dereferences a raw pointer to a 32-bit float
Dereferences a raw pointer to a 32-bit float
(r-f64 ptr)
Dereferences a raw pointer to a 64-bit float
Dereferences a raw pointer to a 64-bit float
(r-i16 ptr)
Dereferences a raw pointer to a signed 16-bit integer.
Dereferences a raw pointer to a signed 16-bit integer.
(r-i32 ptr)
Dereferences a raw pointer to a signed 32-bit integer.
Dereferences a raw pointer to a signed 32-bit integer.
(r-i8 ptr)
Dereferences a raw pointer to a signed 8-bit integer.
Dereferences a raw pointer to a signed 8-bit integer.
(r-ptr ptr)
Dereference a raw pointer to a pointer.
Dereference a raw pointer to a pointer.
(r-u16 ptr)
Dereferences a raw pointer to an unsigned 16-bit integer.
Dereferences a raw pointer to an unsigned 16-bit integer.
(r-u32 ptr)
Dereferences a raw pointer to an unsigned 32-bit integer.
Dereferences a raw pointer to an unsigned 32-bit integer.
(r-u8 ptr)
Dereferences a raw pointer to an unsigned 8-bit integer.
Dereferences a raw pointer to an unsigned 8-bit integer.
(realloc ptr n-byte)
Re-allocates a raw pointer.
Re-allocates a raw pointer.
(view n-byte)
Allocates n-byte
bytes in native memory, outside of the JVM heap, and returns a view over it.
Very useful for performance increase in some situations or for interacting with native functions.
The returned view is actually a DirectByteBuffer
commonly understood by many tools (such as JNI).
Allocates `n-byte` bytes in native memory, outside of the JVM heap, and returns a view over it. Very useful for performance increase in some situations or for interacting with native functions. The returned view is actually a `DirectByteBuffer` commonly understood by many tools (such as JNI).
(w-b16 ptr b16)
Writes a 16-bit integer at the given raw pointer.
Writes a 16-bit integer at the given raw pointer.
(w-b32 ptr b32)
Writes a 32-bit integer at the given raw pointer.
Writes a 32-bit integer at the given raw pointer.
(w-b64 ptr b64)
Writes a 64-bit integer at the given raw pointer.
Writes a 64-bit integer at the given raw pointer.
(w-b8 ptr b8)
Writes an 8-bit integer at the given raw pointer.
Writes an 8-bit integer at the given raw pointer.
(w-f32 ptr f32)
Writes a 32-bit float at the given raw pointer.
Writes a 32-bit float at the given raw pointer.
(w-f64 ptr f64)
Writes a 64-bit float at the given raw pointer.
Writes a 64-bit float at the given raw pointer.
(w-ptr ptr ptr-value)
Writes a pointer at the given raw pointer.
Writes a pointer at the given raw pointer.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close