summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/reference/ChangeLog6
-rw-r--r--docs/reference/glib/glib-sections.txt4
-rw-r--r--docs/reference/glib/tmpl/macros_misc.sgml26
3 files changed, 36 insertions, 0 deletions
diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog
index ac144a8b1..9183d5caa 100644
--- a/docs/reference/ChangeLog
+++ b/docs/reference/ChangeLog
@@ -1,3 +1,9 @@
+2002-11-20 Matthias Clasen <maclas@gmx.de>
+
+ * glib/tmpl/macros_misc.sgml: Document G_LIKELY, G_UNLIKELY.
+
+ * glib/glib-sections.txt: Add G_LIKELY, G_UNLIKELY.
+
2002-10-20 Matthias Clasen <maclas@gmx.de>
* gobject/Makefile.am (SCANOBJ_FILES):
diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt
index 4fd6fcb87..80e408518 100644
--- a/docs/reference/glib/glib-sections.txt
+++ b/docs/reference/glib/glib-sections.txt
@@ -297,6 +297,10 @@ G_GNUC_PRETTY_FUNCTION
G_GNUC_NO_INSTRUMENT
<SUBSECTION>
+G_LIKELY
+G_UNLIKELY
+
+<SUBSECTION>
G_STRLOC
<SUBSECTION>
diff --git a/docs/reference/glib/tmpl/macros_misc.sgml b/docs/reference/glib/tmpl/macros_misc.sgml
index bdccfc629..d16bc1702 100644
--- a/docs/reference/glib/tmpl/macros_misc.sgml
+++ b/docs/reference/glib/tmpl/macros_misc.sgml
@@ -237,6 +237,32 @@ See the GNU C documentation for details.
+<!-- ##### MACRO G_LIKELY ##### -->
+<para>
+Hints the compiler that the expression is likely to evaluate to a true
+value. The compiler may use this information for optimizations.
+</para>
+<informalexample><programlisting>
+if (G_LIKELY (random () != 1))
+ g_print ("not one");
+</programlisting></informalexample>
+
+@expr: the expression
+
+
+<!-- ##### MACRO G_UNLIKELY ##### -->
+<para>
+Hints the compiler that the expression is unlikely to evaluate to a true
+value. The compiler may use this information for optimizations.
+</para>
+<informalexample><programlisting>
+if (G_UNLIKELY (random () == 1))
+ g_print ("a random one");
+</programlisting></informalexample>
+
+@expr: the expression
+
+
<!-- ##### MACRO G_STRLOC ##### -->
<para>
Expands to a string identifying the current code position.