just never forget that we have a moving GC! ;) so directly passing references
to native function can be quite dangerous!

Otherwise you could first manually adjust the start address by writing
the corresponding ASM code ;) then run the C callout. I should check if
we already have a proper helper method for that.


On 2012-11-07, at 14:33, Mariano Martinez Peck <[email protected]> wrote:

> Hi Igor. I wonder if I can do the following.
> I have to pass a ByteArray to a function that expects an already malloced
> char*.
> So far it is working fine. Now...what I would like is from the image side
> to allocate a ByteArray of size + 4. I need to reserve the first 4 bytes of
> the ByteArray for something. But the library I am calling doesn't let me
> specify where to start from that char*.
> So...can I cheat? I mean, can I allocate ByteArray+4 in the image, but when
> passing it as an argument somehow say "ok, take this ByteArray but think
> the the beginning is the byte 4" ?
> or something like that ?
> 
> Thanks!
> 
> -- 
> Mariano
> http://marianopeck.wordpress.com


Reply via email to