Carlos, the code that you showed can be completely written in Julia. It 
would be helpful if you could give us more insight what you want to 
achieve. Is there a specific API that you want to wrap? You said that the 
API returns a double pointer but the length of the memory is not know (if I 
get that right) How can one use this pointer if the length is unknown?

Am Sonntag, 9. Februar 2014 12:46:24 UTC+1 schrieb Carlos Becker:
>
> I think I finally made it work, close to what I wanted.
>
> This could be good for future reference for anyone trying to do something 
> similar.
> The code is at https://gist.github.com/anonymous/8897943.
>
> I have two questions about it:
>   1) calling jl_gc_disable() and jl_gc_enable() is ok in that context? 
> (see link above)
>   2) I still don't know how to avoid passing a pointer to the module I 
> want to get the type from to the C call.
>
> Thanks.
>
>
> El domingo, 9 de febrero de 2014 00:40:33 UTC+1, Carlos Becker escribió:
>>
>> Hi Steven,
>>
>> I tried that before, I know it is possible, but if the size is unknown to 
>> julia, it must be returned as another variable, which makes
>> coding more difficult if many of such return arrays are needed.
>>
>> That is why I think it would be interesting to see the julia-api side of 
>> it, to see if this can be avoided.
>> (I prefer to write a bit more of C code but make the ccall clearer in 
>> julia)
>>
>> About my previous question, I am still struggling to create a custom type 
>> with julia's C API and fill it in, to pass it back then.
>> Has anyone done this in such scenario before? I wonder if the necessary 
>> symbols are already exported for 3rd party use.
>>
>> Cheers.
>>
>

Reply via email to