> Aren't composite types in julia only referenced by pointer? no, they are julia-allocated objects and so they can be converted to Ptr but cannot be converted from Ptr.
On Wed, Jun 10, 2015 at 1:34 AM Andreas Lobinger <[email protected]> wrote: > > > On Tuesday, June 9, 2015 at 9:15:44 PM UTC+2, Tobias Knopp wrote: >> >> Hi Andreas, >> >> the function cairo_copy_path does return a pointer to a cairo_path_t. So >> the return value of your ccall is wrong. >> > > function pdata_copy_path(ctx::CairoContext) > c = ccall((:cairo_copy_path, Cairo._jl_libcairo), > Ptr{Pdata}, (Ptr{Void},),ctx.ptr) > unsafe_load(c,1) > end > > is working. But the Ptr + unsafe_load seemed to be so redundant? Aren't > composite types in julia only referenced by pointer? >
