Alain Meunier wrote: > So basically anything my bytes[5] may be lost if the system need that memory > space, right ? Lost? No, it's a grave mistake to access out-of-bounds elements and this may lead to crashes. Don't do it. The FFI is like C: there's no hand-holding. > Obviously it will not be the case with bytes[2] because it is in the bounds. No, bytes[0] and bytes[1] are the only valid indexes. I cannot recommend to use the FFI without a firm grasp of C's memory model. E.g. zero-based indexing or the width of types (an array of int cannot reasonably be called 'bytes'). > And this code is realistic enough to be used in production. Oh dear. --Mike