Functions that return an object in 1.79 will return Ptr type in 1.82, please use unsafe_load to explicitly copy the object in your old code base.
For example, igGetIO() returns a pointer of type Ptr{ImGuiIO} in 1.82.
With this field access method in 1.79, say we have io::Ptr{ImGuiIO}=igGetIO(), then we can run ds = io.DisplaySize to get an object ds of type ImVec2.
The new field access method generated by Clang.jl now returns a pointer(in the above example, Ptr{ImVec2}) instead of an object(in the above example, ImVec2).
We are making this change because we want a small memory footprint and chaining support:
io.DisplaySize.x will now return a pointer and we can explicitly write unsafe_load(io.DisplaySize.x) to copy the value. In this case, only the value x is copied from C to Julia, not the whole object io.DisplaySize.
In 1.82, it will be a lot easier to read/load/copy a single value from a big nested struct without copying the whole struct object from C to Julia.
Functions that return an object in 1.79 will return
Ptr
type in 1.82, please useunsafe_load
to explicitly copy the object in your old code base.For example,
igGetIO()
returns a pointer of typePtr{ImGuiIO}
in 1.82.With this field access method in 1.79, say we have
io::Ptr{ImGuiIO}=igGetIO()
, then we can runds = io.DisplaySize
to get an objectds
of typeImVec2
.The new field access method generated by Clang.jl now returns a pointer(in the above example,
Ptr{ImVec2}
) instead of an object(in the above example,ImVec2
).We are making this change because we want a small memory footprint and chaining support:
io.DisplaySize.x
will now return a pointer and we can explicitly writeunsafe_load(io.DisplaySize.x)
to copy the value. In this case, only the valuex
is copied from C to Julia, not the whole objectio.DisplaySize
.In 1.82, it will be a lot easier to read/load/copy a single value from a big nested struct without copying the whole struct object from C to Julia.