Re: Overhead of type casting when using GObject system
- From: Alberto Garcia <agarcia igalia com>
- To: gtk-devel-list gnome org
- Subject: Re: Overhead of type casting when using GObject system
- Date: Sat, 9 Feb 2013 13:35:49 +0100
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.
Berto
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]