Do you mean something different from

    cobj = Array(Uint8, len)
    ccall(:foo, void, (Ptr{Void},), cobj)

?
--Tim

On Thursday, February 26, 2015 10:50:51 PM James Crist wrote:
> This is more of a curiousity question than an actual use case. Is there any
> way to have Julia manage heap allocated memory that is initialized by a C
> function? By this, I mean suppose I had a function:
> 
> void foo(void *x) {
>      ...initize some structure in C here from the memory passed in by x...
> }
> 
> In C, I would malloc, then pass in the memory to the initialization. Is
> there any way to do this in Julia, but have Julia manage the memory?

Reply via email to