[Gambas-devel] Arrays memory layout

Adrien Prokopowicz adrien.prokopowicz at ...176...
Fri Jul 28 21:51:05 CEST 2017


Hi folks, I have a little question about Gambas Arrays in native  
components.

In order to get/put data, according to the docs[0] the only way I have is  
to call
Array.Get() to retrieve a pointer to the given index.

But since calling this for every index could be pretty slow, I was  
wondering if I could
consider the pointer returned by Array.Get(0) to be the start of a  
continuous memory
block of the size of the array, so I could directly access it (and use  
memcpy and such) ?

Having read the source code and tested a bit I think this is safe, but  
since the array
type is opaque and there is no other exposed method than Get(), I would  
like to be
sure there is no hidden shenanigan going on. :-)

Regards,

[0] http://gambaswiki.org/wiki/dev/api/cat/array

-- 
Adrien Prokopowicz




More information about the Devel mailing list