Re: [Vala] arrays of strings not properly initialized.



On Sat, 2007-08-18 at 23:24 +0200, Mathias Hasselmann wrote:
Am Donnerstag, den 16.08.2007, 11:25 +0200 schrieb Raffaele Sandrini:
Fixed in SVN.

Seems your code forgets to add the NULL sentinel needed by functions
like g_strfreev. Patch ok to commit?
The point is not that the sentinel is missing... We have two possible
ways to represent arrays in vala. One with terminating sentinels (NULL)
and one where we know the length of the arrays through a separate
variable. When creating arrays in vala the latter is used. So the real
problem is that g_strfreev is used to free those strings. Now, the
question is since string arrays are almost never equally sized, whether
it is not more optimal not to use size variables in the special case of
string arrays and to use sentinels instead.

(Note that when using size variables the array length in each dimension
has to be of the same length.)

My patch only managed to place those initialization strings into the
correct memory block.


What about those patches?

[Bug 468026] Support as operator
[Bug 467896] switch block frees too many variables
I have not reviewed them yet. 

Raffaele




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