After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 622145 - valac generates unnecessary duplicate code when appending to array
valac generates unnecessary duplicate code when appending to array
Status: RESOLVED DUPLICATE of bug 621220
Product: vala
Classification: Core
Component: Arrays
0.9.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2010-06-20 01:24 UTC by celil.kj
Modified: 2010-06-20 08:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description celil.kj 2010-06-20 01:24:17 UTC
Consider the following example

void main()
{
	int[] y = {};	
	y += 1;
	y += 2;
	y += 3;
	y += 4;
	
}

compiling this with the -C flag set, the generated C code includes the following declaration

static void _vala_array_add1 (gint** array, int* length, int* size, gint value);
static void _vala_array_add2 (gint** array, int* length, int* size, gint value);
static void _vala_array_add3 (gint** array, int* length, int* size, gint value);
static void _vala_array_add4 (gint** array, int* length, int* size, gint value);

all of which have the same identical implementation. Why is it necessary to generate multiple functions with identical implementations for each statement in vala when one would be sufficient? If one were to use the append statement very often, vala would end up generating a really huge binary.
Comment 1 Luca Bruno 2010-06-20 08:07:02 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

*** This bug has been marked as a duplicate of bug 621220 ***