From ecab7458479b696018617c5e7d0eb55c0150be1f Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Wed, 13 Jun 2007 18:58:49 +0000 Subject: [PATCH] glib/glib-sections.txt document g_slice_copy() and g_slice_dup(). 2007-06-13 Sven Neumann * glib/glib-sections.txt * glib/tmpl/memory_slices.sgml: document g_slice_copy() and g_slice_dup(). svn path=/trunk/; revision=5555 --- docs/reference/ChangeLog | 6 +++++ docs/reference/glib/glib-sections.txt | 2 ++ docs/reference/glib/tmpl/memory_slices.sgml | 29 +++++++++++++++++++++ 3 files changed, 37 insertions(+) diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 363743ec..41f09a96 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,9 @@ +2007-06-13 Sven Neumann + + * glib/glib-sections.txt + * glib/tmpl/memory_slices.sgml: document g_slice_copy() and + g_slice_dup(). + 2007-06-13 Matthias Clasen * glib/tmpl/warnings.sgml: Add some verbiage about diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt index 99129027..d4450623 100644 --- a/docs/reference/glib/glib-sections.txt +++ b/docs/reference/glib/glib-sections.txt @@ -1735,12 +1735,14 @@ g_mem_chunk_print memory_slices g_slice_alloc g_slice_alloc0 +g_slice_copy g_slice_free1 g_slice_free_chain_with_offset g_slice_new g_slice_new0 +g_slice_dup g_slice_free g_slice_free_chain diff --git a/docs/reference/glib/tmpl/memory_slices.sgml b/docs/reference/glib/tmpl/memory_slices.sgml index 372192c5..a562ffe3 100644 --- a/docs/reference/glib/tmpl/memory_slices.sgml +++ b/docs/reference/glib/tmpl/memory_slices.sgml @@ -121,6 +121,18 @@ environment variable. @Since: 2.10 + + +Allocates a block of memory from the slice allocator and copies +@block_size bytes into it from @mem_block. + + +@block_size: the number of bytes to allocate +@mem_block: the memory to copy +@Returns: a pointer to the allocated memory block +@Since: 2.14 + + Frees a block of memory. The memory must have been allocated via @@ -186,6 +198,23 @@ environment variable. @Since: 2.10 + + +A convenience macro to duplicate a block of memory using the slice allocator. +It calls g_slice_copy() with sizeof (@type) and casts +the returned pointer to a pointer of the given type, avoiding a type cast +in the source code. +Note that the underlying slice allocation mechanism can +be changed with the G_SLICE=always-malloc +environment variable. + + +@type: the type to duplicate, typically a structure name +@mem: the memory to copy into the allocated block +@Returns: a pointer to the allocated block, cast to a pointer to @type. +@Since: 2.14 + + A convenience macro to free a block of memory that has been allocated -- 2.34.1