[Vala] Change in 0.23.1 for array ownership and .length parameter



Just wanted to give everyone a head's-up about a change that appeared in Vala 0.23. Previously you could do this in Vala:

uint8[] ar = new uint8[10];
// ... fill ar with interesting bytes ...
process((owned) ar, ar.length);

... where process() takes an array and a length field (sometimes because an array might have a "filled" count versus it's allocated length). Before 0.23 the above worked, but now ar.length will be zeroed out before it's passed to process():

https://bugzilla.gnome.org/show_bug.cgi?id=721001

I found a few instances of this pattern in our code and thought others might want to be alerted about it as well.

-- Jim


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]