Get the raw address value of this pointer.
The memory address as a bigint.
Check if this is a null pointer (C_NULL).
Get the raw pointer value (same as address but as Bun's Pointer type).
Load a value from the pointer location.
Equivalent to Julia's unsafe_load(ptr, i).
WARNING: This is an unsafe operation!
Element offset (0-based, default 0). Offset is in units of the element type size, not bytes.
The value at the pointer location.
Create a new pointer offset by n elements.
Note: Julia's ptr + n offsets by n bytes. This method offsets by
n elements (n * sizeof(T) bytes) for more intuitive usage.
Number of elements to offset (can be negative).
A new JuliaPtr pointing to the offset location.
Reinterpret this pointer as a different type.
Equivalent to reinterpret(Ptr{T}, ptr) in Julia.
The new element type (e.g., Julia.Float64).
A new JuliaPtr with the reinterpreted type.
Store a value at the pointer location.
Equivalent to Julia's unsafe_store!(ptr, value, i).
WARNING: This is an unsafe operation!
The value to store.
Element offset (0-based, default 0). Offset is in units of the element type size, not bytes.
StaticfromCreate a Ptr{Cvoid} from a raw address.
The memory address as a number or bigint.
A new JuliaPtr pointing to the address.
StaticfromGet the data pointer from a JuliaArray.
The Julia array.
A JuliaPtr pointing to the array's data.
StaticfromGet the memory address of any Julia object.
WARNING: The returned pointer is only valid while the object is protected from garbage collection! Use with extreme caution.
Any Julia value.
A JuliaPtr pointing to the object's memory location.
Wrapper for Julia
Ptr{T}- typed pointer for FFI and memory operations.Julia's
Ptr{T}is used for:Safety Warning
Operations like
load()andstore()are unsafe - they can cause segfaults or memory corruption if used incorrectly. The caller is responsible for ensuring:Example