Re: Overhead of type casting when using GObject system




On 09/02/13 13:35, Alberto Garcia wrote:
On Sat, Feb 09, 2013 at 10:53:25AM +0100, Lanoxx wrote:

So if in C if write this:
GtkGrid* grid = gtk_grid_new();
GtkWidget* widget = GTK_WIDGET(grid);

then this creates more overhead then when in Java I write this:
JTabel tabel = new JTabel();
Object object = tabel; // No cast required.
gtk_grid_new() actually returns a GtkWidget*, but otherwise you're
right.

However those cast checks can be disabled at compile time removing the
overhead, so GTK_WIDGET(foo) would be equivalent to (GtkWidget *) foo.
Ah thats good to know. But still I believe that most applications that are shipped with gnome are not compiled that way. So what overhead does that actually create.

Berto
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list



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