From 7735d799c5b15ddb1896c633e7c57331b0c001e3 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 28 Nov 2004 19:13:36 +0000 Subject: [PATCH] Document G_GNUC_MALLOC. 2004-11-28 Matthias Clasen * glib/tmpl/macros_misc.sgml: Document G_GNUC_MALLOC. * glib/glib-sections.txt: Add G_GNUC_MALLOC --- docs/reference/ChangeLog | 6 ++++ docs/reference/glib/glib-sections.txt | 3 +- docs/reference/glib/tmpl/macros_misc.sgml | 55 ++++++++++++++++++------------- 3 files changed, 41 insertions(+), 23 deletions(-) diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 1666167..c2c1b2e 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,9 @@ +2004-11-28 Matthias Clasen + + * glib/tmpl/macros_misc.sgml: Document G_GNUC_MALLOC. + + * glib/glib-sections.txt: Add G_GNUC_MALLOC + 2004-11-12 Matthias Clasen * === Released 2.5.6 === diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt index 810535c..5cfd100 100644 --- a/docs/reference/glib/glib-sections.txt +++ b/docs/reference/glib/glib-sections.txt @@ -314,10 +314,11 @@ G_STRINGIFY G_GNUC_EXTENSION G_GNUC_CONST +G_GNUC_PURE +G_GNUC_MALLOC G_GNUC_DEPRECATED G_GNUC_NORETURN G_GNUC_UNUSED -G_GNUC_PURE G_GNUC_PRINTF G_GNUC_SCANF G_GNUC_FORMAT diff --git a/docs/reference/glib/tmpl/macros_misc.sgml b/docs/reference/glib/tmpl/macros_misc.sgml index 9ea09c5..2c57c77 100644 --- a/docs/reference/glib/tmpl/macros_misc.sgml +++ b/docs/reference/glib/tmpl/macros_misc.sgml @@ -103,11 +103,10 @@ when compiling with the option. -Expands to the GNU C const function attribute if the compiler is gcc. -Declaring a function as const enables better optimization of the function. -A const function doesn't examine any values except its parameters, -and has no effects except its return value. -See the GNU C documentation for details. +Expands to the GNU C const function attribute if the compiler is +gcc. Declaring a function as const enables better optimization of calls +to the function. A const function doesn't examine any values except its parameters, and has no +effects except its return value. See the GNU C documentation for details. A function that has pointer arguments and examines the data pointed to @@ -118,6 +117,30 @@ for a const function to return void. + + +Expands to the GNU C pure function attribute if the compiler is +gcc. Declaring a function as pure enables better optimization of +calls to the function. A pure function has no effects except its return value and the +return value depends only on the parameters and/or global variables. +See the GNU C documentation for details. + + + + + + +Expands to the GNU C malloc function attribute if the compiler is +gcc. Declaring a function as malloc enables better optimization of the +function. A function can have the malloc attribute if it returns a pointer which is guaranteed +to not alias with any other pointer when the function returns (in practice, this means newly +allocated memory). +See the GNU C documentation for details. + + +@Since: 2.6 + + Expands to the GNU C deprecated attribute if the compiler @@ -134,8 +157,7 @@ See the GNU C documentation for details. Expands to the GNU C noreturn function attribute if the -compiler is gcc. -It is used for declaring functions which never return. +compiler is gcc. It is used for declaring functions which never return. It enables optimization of the function, and avoids possible compiler warnings. See the GNU C documentation for details. @@ -144,28 +166,17 @@ warnings. See the GNU C documentation for details. -Expands to the GNU C unused function attribute if the compiler is gcc. -It is used for declaring functions which may never be used. +Expands to the GNU C unused function attribute if the compiler is +gcc. It is used for declaring functions which may never be used. It avoids possible compiler warnings. See the GNU C documentation for details. - - -Expands to the GNU C pure function attribute if the compiler is gcc. -Declaring a function as pure enables better optimization of the function. -A pure function has no effects except its return value and the return -value depends only on the parameters and/or global variables. -See the GNU C documentation for details. - - - - -Expands to the GNU C format function attribute if the compiler is gcc. -This is used for declaring functions which take a variable number of +Expands to the GNU C format function attribute if the compiler is +gcc. This is used for declaring functions which take a variable number of arguments, with the same syntax as printf(). It allows the compiler to type-check the arguments passed to the function. See the GNU C documentation for details. -- 2.7.4