Unmanaged Pointers
Conjure’s default memory model is identical to that of C, meaning that values are passed by value by default. However, Conjure also supports unmanaged (weak) pointers, which allow you to work with memory addresses directly.
var x i32 = 42
var p *i32 = &x // p is a pointer to xIn addition to unmanaged pointers which are type-safe, Conjure also supports “raw” pointers, which are similar to void* in C. Raw pointers can point to any type of data, but they lack type safety and require explicit casting.
var x i32 = 42
var ptr = rawptr(&x) // ptr is a raw pointer to x
var iptr = (*i32)ptr // cast raw pointer back to i32 pointerIn Conjure, you can dereference pointers using the * operator to access or modify the value they point to.
var x i32 = 42
var p *i32 = &x
println(*p) // prints 42
*p = 100
println(x) // prints 100Managed Pointers Proposed
TODO
Nullable Managed Pointers Proposed
TODO