Liking cljdoc? Tell your friends :D

helins.binf.native

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 <!>
raw docstring

allocclj

(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.
sourceraw docstring

copyclj

(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.
sourceraw docstring

freeclj

(free ptr)

De-allocates a raw pointer.

De-allocates a raw pointer.
sourceraw docstring

n-byte-ptrclj

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.
sourceraw docstring

r-b64clj

(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.
sourceraw docstring

r-f32clj

(r-f32 ptr)

Dereferences a raw pointer to a 32-bit float

Dereferences a raw pointer to a 32-bit float
sourceraw docstring

r-f64clj

(r-f64 ptr)

Dereferences a raw pointer to a 64-bit float

Dereferences a raw pointer to a 64-bit float
sourceraw docstring

r-i16clj

(r-i16 ptr)

Dereferences a raw pointer to a signed 16-bit integer.

Dereferences a raw pointer to a signed 16-bit integer.
sourceraw docstring

r-i32clj

(r-i32 ptr)

Dereferences a raw pointer to a signed 32-bit integer.

Dereferences a raw pointer to a signed 32-bit integer.
sourceraw docstring

r-i8clj

(r-i8 ptr)

Dereferences a raw pointer to a signed 8-bit integer.

Dereferences a raw pointer to a signed 8-bit integer.
sourceraw docstring

r-ptrclj

(r-ptr ptr)

Dereference a raw pointer to a pointer.

Dereference a raw pointer to a pointer.
sourceraw docstring

r-u16clj

(r-u16 ptr)

Dereferences a raw pointer to an unsigned 16-bit integer.

Dereferences a raw pointer to an unsigned 16-bit integer.
sourceraw docstring

r-u32clj

(r-u32 ptr)

Dereferences a raw pointer to an unsigned 32-bit integer.

Dereferences a raw pointer to an unsigned 32-bit integer.
sourceraw docstring

r-u8clj

(r-u8 ptr)

Dereferences a raw pointer to an unsigned 8-bit integer.

Dereferences a raw pointer to an unsigned 8-bit integer.
sourceraw docstring

reallocclj

(realloc ptr n-byte)

Re-allocates a raw pointer.

Re-allocates a raw pointer.
sourceraw docstring

viewclj

(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).
sourceraw docstring

w-b16clj

(w-b16 ptr b16)

Writes a 16-bit integer at the given raw pointer.

Writes a 16-bit integer at the given raw pointer.
sourceraw docstring

w-b32clj

(w-b32 ptr b32)

Writes a 32-bit integer at the given raw pointer.

Writes a 32-bit integer at the given raw pointer.
sourceraw docstring

w-b64clj

(w-b64 ptr b64)

Writes a 64-bit integer at the given raw pointer.

Writes a 64-bit integer at the given raw pointer.
sourceraw docstring

w-b8clj

(w-b8 ptr b8)

Writes an 8-bit integer at the given raw pointer.

Writes an 8-bit integer at the given raw pointer.
sourceraw docstring

w-f32clj

(w-f32 ptr f32)

Writes a 32-bit float at the given raw pointer.

Writes a 32-bit float at the given raw pointer.
sourceraw docstring

w-f64clj

(w-f64 ptr f64)

Writes a 64-bit float at the given raw pointer.

Writes a 64-bit float at the given raw pointer.
sourceraw docstring

w-ptrclj

(w-ptr ptr ptr-value)

Writes a pointer at the given raw pointer.

Writes a pointer at the given raw pointer.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close