Revert "gatomic: statically assert that our assumptions hold"
[platform/upstream/glib.git] / glib / gmem.h
index c50f46e..e1d88d5 100644 (file)
@@ -12,9 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
  * GLib at ftp://ftp.gtk.org/pub/gtk/.
  */
 
+#ifndef __G_MEM_H__
+#define __G_MEM_H__
+
 #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
 #error "Only <glib.h> can be included directly."
 #endif
 
-#ifndef __G_MEM_H__
-#define __G_MEM_H__
-
 #include <glib/gtypes.h>
 
 G_BEGIN_DECLS
@@ -67,32 +65,45 @@ typedef struct _GMemVTable GMemVTable;
 /* Memory allocation functions
  */
 
+GLIB_AVAILABLE_IN_ALL
 void    g_free           (gpointer      mem);
 
 GLIB_AVAILABLE_IN_2_34
 void     g_clear_pointer  (gpointer      *pp,
                            GDestroyNotify destroy);
 
+GLIB_AVAILABLE_IN_ALL
 gpointer g_malloc         (gsize        n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1);
+GLIB_AVAILABLE_IN_ALL
 gpointer g_malloc0        (gsize        n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1);
+GLIB_AVAILABLE_IN_ALL
 gpointer g_realloc        (gpointer     mem,
                           gsize         n_bytes) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
 gpointer g_try_malloc     (gsize        n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1);
+GLIB_AVAILABLE_IN_ALL
 gpointer g_try_malloc0    (gsize        n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1);
+GLIB_AVAILABLE_IN_ALL
 gpointer g_try_realloc    (gpointer     mem,
                           gsize         n_bytes) G_GNUC_WARN_UNUSED_RESULT;
 
+GLIB_AVAILABLE_IN_ALL
 gpointer g_malloc_n       (gsize        n_blocks,
                           gsize         n_block_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE2(1,2);
+GLIB_AVAILABLE_IN_ALL
 gpointer g_malloc0_n      (gsize        n_blocks,
                           gsize         n_block_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE2(1,2);
+GLIB_AVAILABLE_IN_ALL
 gpointer g_realloc_n      (gpointer     mem,
                           gsize         n_blocks,
                           gsize         n_block_bytes) G_GNUC_WARN_UNUSED_RESULT;
+GLIB_AVAILABLE_IN_ALL
 gpointer g_try_malloc_n   (gsize        n_blocks,
                           gsize         n_block_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE2(1,2);
+GLIB_AVAILABLE_IN_ALL
 gpointer g_try_malloc0_n  (gsize        n_blocks,
                           gsize         n_block_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE2(1,2);
+GLIB_AVAILABLE_IN_ALL
 gpointer g_try_realloc_n  (gpointer     mem,
                           gsize         n_blocks,
                           gsize         n_block_bytes) G_GNUC_WARN_UNUSED_RESULT;
@@ -270,7 +281,9 @@ struct _GMemVTable {
   gpointer (*try_realloc) (gpointer mem,
                           gsize    n_bytes);
 };
+GLIB_AVAILABLE_IN_ALL
 void    g_mem_set_vtable (GMemVTable   *vtable);
+GLIB_AVAILABLE_IN_ALL
 gboolean g_mem_is_system_malloc (void);
 
 GLIB_VAR gboolean g_mem_gc_friendly;
@@ -278,6 +291,7 @@ GLIB_VAR gboolean g_mem_gc_friendly;
 /* Memory profiler and checker, has to be enabled via g_mem_set_vtable()
  */
 GLIB_VAR GMemVTable    *glib_mem_profiler_table;
+GLIB_AVAILABLE_IN_ALL
 void   g_mem_profile   (void);
 
 G_END_DECLS