[Gegl-developer] Question about the use of C99/gcc built-in math intrinsics within GEGL on gfloats

Sven Neumann sven at gimp.org
Sat Sep 13 02:02:11 PDT 2008


Hi,

On Sat, 2008-09-13 at 09:37 +0200, Sven Neumann wrote:

> It looks like the restrict keyword could be easily wrapped into a macro

The following code seems to do the trick. It introduces G_GNUC_RESTRICT,
which is actually in the GLib namespace. But I hope that we can convince
the GLib developers that it makes sense to add it. At some point we
could then remove our definition:


#ifndef G_GNUC_RESTRICT

#if defined (__GNUC__) && (__GNUC__ >= 4)
#define G_GNUC_RESTRICT __restrict__
#else
#define G_GNUC_RESTRICT
#endif

#endif


I haven't yet tested if this works and how much of a difference it
makes. If I find time later I might try if it helps to optimize some
common code paths in GIMP.


Sven




More information about the Gegl-developer mailing list