Re: Please give this patch a once-over



[ Changed CC gtk-devel-list instead of gtkdev, since gtkdev no longer
  corresponds very well to the set of people actively working on
  GTK+/GLib ]

Elliot Lee <sopwith redhat com> writes:

> I patched glib to allow using the gcc 'pure' attribute (in gcc >= 2.96,
> like 'const' but allows accessing global variables, so more broadly
> applicable). I'm paranoid about accidentally marking g_malloc as
> G_GNUC_PURE or something, so would like to get someone just to
> sanity-check it before I commit it.

I'm not sure I understand pure enough to really do this job well.
In particular, I don't quite trust the interaction of pure with
threading.

As an obvious case, this:

> -gboolean	g_main_is_running	(GMainLoop	*loop);
> +gboolean	g_main_is_running	(GMainLoop	*loop) G_GNUC_PURE;

will shortly be wrong, because the GMainLoop object will have
automatic locking from multiple threads.

(BTW, g_main_pending() is definitely _NOT_ pure.) 

Before we procede with this any, could you show some .S files
where the code generation of reasonable code using glib is
improved by the introduction of pure?

Thanks,
                                        Owen




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