| Current File : //usr/share/doc/dbus/api/group__DBusMemory.html |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>D-Bus: Memory Allocation</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">D-Bus
 <span id="projectnumber">1.8.20</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#define-members">Defines</a> |
<a href="#typedef-members">Typedefs</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Memory Allocation</div> </div>
<div class="ingroups"><a class="el" href="group__DBus.html">D-Bus low-level public API</a></div></div><!--header-->
<div class="contents">
<p><a class="el" href="group__DBusMemory.html#gaf6e588659067a854c3cca7ebe8ae5084" title="Allocates the given number of bytes, as with standard malloc().">dbus_malloc()</a>, <a class="el" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a" title="Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().">dbus_free()</a>, etc.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#ga54ccb556e7964112a825a7f46c156ca0">dbus_new</a>(type, count)   ((type*)<a class="el" href="group__DBusMemory.html#gaf6e588659067a854c3cca7ebe8ae5084">dbus_malloc</a> (sizeof (type) * (count)))</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Safe macro for using <a class="el" href="group__DBusMemory.html#gaf6e588659067a854c3cca7ebe8ae5084" title="Allocates the given number of bytes, as with standard malloc().">dbus_malloc()</a>. <a href="#ga54ccb556e7964112a825a7f46c156ca0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#gaba9d823abda7f4cadbaf5177d3b8b793">dbus_new0</a>(type, count)   ((type*)<a class="el" href="group__DBusMemory.html#gaa02722b030a091f6c14c4cb11a593623">dbus_malloc0</a> (sizeof (type) * (count)))</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Safe macro for using <a class="el" href="group__DBusMemory.html#gaa02722b030a091f6c14c4cb11a593623" title="Allocates the given number of bytes, as with standard malloc(), but all bytes are initialized to zero...">dbus_malloc0()</a>. <a href="#gaba9d823abda7f4cadbaf5177d3b8b793"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5">DBusFreeFunction</a> )(void *memory)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The type of a function which frees a block of memory. <a href="#ga061bcded226d76c7d7de35beaa165cb5"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#gaf6e588659067a854c3cca7ebe8ae5084">dbus_malloc</a> (size_t bytes)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Allocates the given number of bytes, as with standard malloc(). <a href="#gaf6e588659067a854c3cca7ebe8ae5084"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#gaa02722b030a091f6c14c4cb11a593623">dbus_malloc0</a> (size_t bytes)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Allocates the given number of bytes, as with standard malloc(), but all bytes are initialized to zero as with calloc(). <a href="#gaa02722b030a091f6c14c4cb11a593623"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#ga2d505f2960ccf343042d363170b27f9c">dbus_realloc</a> (void *memory, size_t bytes)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Resizes a block of memory previously allocated by <a class="el" href="group__DBusMemory.html#gaf6e588659067a854c3cca7ebe8ae5084" title="Allocates the given number of bytes, as with standard malloc().">dbus_malloc()</a> or <a class="el" href="group__DBusMemory.html#gaa02722b030a091f6c14c4cb11a593623" title="Allocates the given number of bytes, as with standard malloc(), but all bytes are initialized to zero...">dbus_malloc0()</a>. <a href="#ga2d505f2960ccf343042d363170b27f9c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a">dbus_free</a> (void *memory)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Frees a block of memory previously allocated by <a class="el" href="group__DBusMemory.html#gaf6e588659067a854c3cca7ebe8ae5084" title="Allocates the given number of bytes, as with standard malloc().">dbus_malloc()</a> or <a class="el" href="group__DBusMemory.html#gaa02722b030a091f6c14c4cb11a593623" title="Allocates the given number of bytes, as with standard malloc(), but all bytes are initialized to zero...">dbus_malloc0()</a>. <a href="#ga34e666b19b015035a9a31e53da84b39a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#gac200b2dbc8b3f6ecac4d42426fb97b40">dbus_free_string_array</a> (char **str_array)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Frees a <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>-terminated array of strings. <a href="#gac200b2dbc8b3f6ecac4d42426fb97b40"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#ga01912903e39428872920d861ef565bac">dbus_shutdown</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Frees all memory allocated internally by libdbus and reverses the effects of <a class="el" href="group__DBusThreads.html#gac7b8a7001befc3eaa8c6b043151008dc" title="Initializes threads, like dbus_threads_init_default().">dbus_threads_init()</a>. <a href="#ga01912903e39428872920d861ef565bac"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p><a class="el" href="group__DBusMemory.html#gaf6e588659067a854c3cca7ebe8ae5084" title="Allocates the given number of bytes, as with standard malloc().">dbus_malloc()</a>, <a class="el" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a" title="Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().">dbus_free()</a>, etc. </p>
<p>Functions and macros related to allocating and releasing blocks of memory. </p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ga54ccb556e7964112a825a7f46c156ca0"></a><!-- doxytag: member="dbus-memory.h::dbus_new" ref="ga54ccb556e7964112a825a7f46c156ca0" args="(type, count)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="group__DBusMemory.html#ga54ccb556e7964112a825a7f46c156ca0">dbus_new</a></td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">type, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">count </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td>   ((type*)<a class="el" href="group__DBusMemory.html#gaf6e588659067a854c3cca7ebe8ae5084">dbus_malloc</a> (sizeof (type) * (count)))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Safe macro for using <a class="el" href="group__DBusMemory.html#gaf6e588659067a854c3cca7ebe8ae5084" title="Allocates the given number of bytes, as with standard malloc().">dbus_malloc()</a>. </p>
<p>Accepts the type to allocate and the number of type instances to allocate as arguments, and returns a memory block cast to the desired type, instead of as a void*.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">type</td><td>type name to allocate </td></tr>
<tr><td class="paramname">count</td><td>number of instances in the allocated array </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the new memory block or <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> on failure </dd></dl>
<p>Definition at line <a class="el" href="dbus-memory_8h_source.html#l00058">58</a> of file <a class="el" href="dbus-memory_8h_source.html">dbus-memory.h</a>.</p>
<p>Referenced by <a class="el" href="dbus-credentials_8c_source.html#l00070">_dbus_credentials_new()</a>, <a class="el" href="dbus-userdb-util_8c_source.html#l00388">_dbus_groups_from_uid()</a>, <a class="el" href="dbus-sysdeps-unix_8c_source.html#l01160">_dbus_listen_systemd_sockets()</a>, <a class="el" href="dbus-server-socket_8c_source.html#l00280">_dbus_server_new_for_socket()</a>, <a class="el" href="dbus-message_8c_source.html#l01587">dbus_message_copy()</a>, and <a class="el" href="dbus-address_8c_source.html#l00363">dbus_parse_address()</a>.</p>
</div>
</div>
<a class="anchor" id="gaba9d823abda7f4cadbaf5177d3b8b793"></a><!-- doxytag: member="dbus-memory.h::dbus_new0" ref="gaba9d823abda7f4cadbaf5177d3b8b793" args="(type, count)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="group__DBusMemory.html#gaba9d823abda7f4cadbaf5177d3b8b793">dbus_new0</a></td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname">type, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname">count </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td>   ((type*)<a class="el" href="group__DBusMemory.html#gaa02722b030a091f6c14c4cb11a593623">dbus_malloc0</a> (sizeof (type) * (count)))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Safe macro for using <a class="el" href="group__DBusMemory.html#gaa02722b030a091f6c14c4cb11a593623" title="Allocates the given number of bytes, as with standard malloc(), but all bytes are initialized to zero...">dbus_malloc0()</a>. </p>
<p>Accepts the type to allocate and the number of type instances to allocate as arguments, and returns a memory block cast to the desired type, instead of as a void*. The allocated array is initialized to all-bits-zero.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">type</td><td>type name to allocate </td></tr>
<tr><td class="paramname">count</td><td>number of instances in the allocated array </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the new memory block or <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> on failure </dd></dl>
<p>Definition at line <a class="el" href="dbus-memory_8h_source.html#l00059">59</a> of file <a class="el" href="dbus-memory_8h_source.html">dbus-memory.h</a>.</p>
<p>Referenced by <a class="el" href="dbus-connection_8c_source.html#l01249">_dbus_connection_new_for_transport()</a>, <a class="el" href="dbus-resources_8c_source.html#l00089">_dbus_counter_new()</a>, <a class="el" href="dbus-object-tree_8c_source.html#l01242">_dbus_decompose_path()</a>, <a class="el" href="dbus-sysdeps-util-unix_8c_source.html#l00777">_dbus_directory_open()</a>, <a class="el" href="dbus-internals_8c_source.html#l00578">_dbus_dup_string_array()</a>, <a class="el" href="dbus-sysdeps-util_8c_source.html#l00049">_dbus_get_environment()</a>, <a class="el" href="dbus-hash_8c_source.html#l00285">_dbus_hash_table_new()</a>, <a class="el" href="dbus-mempool_8c_source.html#l00138">_dbus_mem_pool_new()</a>, <a class="el" href="dbus-message_8c_source.html#l00796">_dbus_message_iter_get_args_valist()</a>, <a class="el" href="dbus-message_8c_source.html#l03863">_dbus_message_loader_new()</a>, <a class="el" href="dbus-object-tree_8c_source.html#l00092">_dbus_object_tree_new()</a>, <a class="el" href="dbus-pending-call_8c_source.html#l00109">_dbus_pending_call_new_unlocked()</a>, <a class="el" href="dbus-server-socket_8c_source.html#l00280">_dbus_server_new_for_socket()</a>, <a class="el" href="dbus-server-socket_8c_source.html#l00388">_dbus_server_new_for_tcp_socket()</a>, <a class="el" href="dbus-timeout_8c_source.html#l00194">_dbus_timeout_list_new()</a>, <a class="el" href="dbus-timeout_8c_source.html#l00063">_dbus_timeout_new()</a>, <a class="el" href="dbus-transport-socket_8c_source.html#l01256">_dbus_transport_new_for_socket()</a>, <a class="el" href="dbus-transport-unix_8c_source.html#l00225">_dbus_transport_open_platform_specific()</a>, <a class="el" href="dbus-userdb_8c_source.html#l00128">_dbus_user_database_lookup()</a>, <a class="el" href="dbus-userdb-util_8c_source.html#l00246">_dbus_user_database_lookup_group()</a>, <a class="el" href="dbus-userdb_8c_source.html#l00550">_dbus_user_database_new()</a>, <a class="el" href="dbus-watch_8c_source.html#l00232">_dbus_watch_list_new()</a>, <a class="el" href="dbus-watch_8c_source.html#l00088">_dbus_watch_new()</a>, <a class="el" href="dbus-connection_8c_source.html#l05511">dbus_connection_add_filter()</a>, <a class="el" href="dbus-message_8c_source.html#l01587">dbus_message_copy()</a>, and <a class="el" href="dbus-address_8c_source.html#l00363">dbus_parse_address()</a>.</p>
</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="ga061bcded226d76c7d7de35beaa165cb5"></a><!-- doxytag: member="dbus-memory.h::DBusFreeFunction" ref="ga061bcded226d76c7d7de35beaa165cb5" args=")(void *memory)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__DBusMemory.html#ga061bcded226d76c7d7de35beaa165cb5">DBusFreeFunction</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The type of a function which frees a block of memory. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">memory</td><td>the memory to free </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="dbus-memory_8h_source.html#l00064">64</a> of file <a class="el" href="dbus-memory_8h_source.html">dbus-memory.h</a>.</p>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga34e666b19b015035a9a31e53da84b39a"></a><!-- doxytag: member="dbus-memory.c::dbus_free" ref="ga34e666b19b015035a9a31e53da84b39a" args="(void *memory)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DBUS_EXPORT void <a class="el" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a">dbus_free</a> </td>
<td>(</td>
<td class="paramtype">void * </td>
<td class="paramname"><em>memory</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Frees a block of memory previously allocated by <a class="el" href="group__DBusMemory.html#gaf6e588659067a854c3cca7ebe8ae5084" title="Allocates the given number of bytes, as with standard malloc().">dbus_malloc()</a> or <a class="el" href="group__DBusMemory.html#gaa02722b030a091f6c14c4cb11a593623" title="Allocates the given number of bytes, as with standard malloc(), but all bytes are initialized to zero...">dbus_malloc0()</a>. </p>
<p>If passed <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, does nothing.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">memory</td><td>block to be freed </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="dbus-memory_8c_source.html#l00701">701</a> of file <a class="el" href="dbus-memory_8c_source.html">dbus-memory.c</a>.</p>
<p>References <a class="el" href="dbus-sysdeps-unix_8c_source.html#l02524">_dbus_atomic_dec()</a>, and <a class="el" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>.</p>
<p>Referenced by <a class="el" href="dbus-auth_8c_source.html#l02346">_dbus_auth_unref()</a>, <a class="el" href="dbus-spawn-win_8c_source.html#l00187">_dbus_babysitter_unref()</a>, <a class="el" href="dbus-connection_8c_source.html#l01249">_dbus_connection_new_for_transport()</a>, <a class="el" href="dbus-resources_8c_source.html#l00089">_dbus_counter_new()</a>, <a class="el" href="dbus-resources_8c_source.html#l00136">_dbus_counter_unref()</a>, <a class="el" href="dbus-credentials_8c_source.html#l00204">_dbus_credentials_add_adt_audit_data()</a>, <a class="el" href="dbus-credentials_8c_source.html#l00180">_dbus_credentials_add_windows_sid()</a>, <a class="el" href="dbus-credentials_8c_source.html#l00446">_dbus_credentials_clear()</a>, <a class="el" href="dbus-credentials_8c_source.html#l00128">_dbus_credentials_unref()</a>, <a class="el" href="dbus-dataslot_8c_source.html#l00154">_dbus_data_slot_allocator_free()</a>, <a class="el" href="dbus-dataslot_8c_source.html#l00340">_dbus_data_slot_list_free()</a>, <a class="el" href="dbus-sysdeps-util-unix_8c_source.html#l00873">_dbus_directory_close()</a>, <a class="el" href="dbus-userdb_8c_source.html#l00089">_dbus_group_info_free()</a>, <a class="el" href="dbus-userdb_8c_source.html#l00061">_dbus_group_info_free_allocated()</a>, <a class="el" href="dbus-hash_8c_source.html#l00285">_dbus_hash_table_new()</a>, <a class="el" href="dbus-hash_8c_source.html#l00361">_dbus_hash_table_unref()</a>, <a class="el" href="dbus-keyring_8c_source.html#l00681">_dbus_keyring_unref()</a>, <a class="el" href="dbus-sysdeps-unix_8c_source.html#l01160">_dbus_listen_systemd_sockets()</a>, <a class="el" href="dbus-sysdeps-unix_8c_source.html#l01378">_dbus_listen_tcp_socket()</a>, <a class="el" href="dbus-mempool_8c_source.html#l00347">_dbus_mem_pool_dealloc()</a>, <a class="el" href="dbus-mempool_8c_source.html#l00187">_dbus_mem_pool_free()</a>, <a class="el" href="dbus-message_8c_source.html#l03863">_dbus_message_loader_new()</a>, <a class="el" href="dbus-message_8c_source.html#l03925">_dbus_message_loader_unref()</a>, <a class="el" href="dbus-object-tree_8c_source.html#l00092">_dbus_object_tree_new()</a>, <a class="el" href="dbus-object-tree_8c_source.html#l00391">_dbus_object_tree_register()</a>, <a class="el" href="dbus-object-tree_8c_source.html#l00143">_dbus_object_tree_unref()</a>, <a class="el" href="dbus-pending-call_8c_source.html#l00109">_dbus_pending_call_new_unlocked()</a>, <a class="el" href="dbus-sysdeps-unix_8c_source.html#l03184">_dbus_printf_string_upper_bound()</a>, <a class="el" href="dbus-server_8c_source.html#l00193">_dbus_server_finalize_base()</a>, <a class="el" href="dbus-server_8c_source.html#l00111">_dbus_server_init_base()</a>, <a class="el" href="dbus-server-unix_8c_source.html#l00054">_dbus_server_listen_platform_specific()</a>, <a class="el" href="dbus-server-unix_8c_source.html#l00237">_dbus_server_new_for_domain_socket()</a>, <a class="el" href="dbus-server-socket_8c_source.html#l00280">_dbus_server_new_for_socket()</a>, <a class="el" href="dbus-server-socket_8c_source.html#l00388">_dbus_server_new_for_tcp_socket()</a>, <a class="el" href="dbus-sysdeps_8c_source.html#l00221">_dbus_split_paths_and_append()</a>, <a class="el" href="dbus-string_8c_source.html#l00242">_dbus_string_free()</a>, <a class="el" href="dbus-timeout_8c_source.html#l00211">_dbus_timeout_list_free()</a>, <a class="el" href="dbus-timeout_8c_source.html#l00107">_dbus_timeout_unref()</a>, <a class="el" href="dbus-transport_8c_source.html#l00216">_dbus_transport_finalize_base()</a>, <a class="el" href="dbus-transport-socket_8c_source.html#l01256">_dbus_transport_new_for_socket()</a>, <a class="el" href="dbus-transport_8c_source.html#l00367">_dbus_transport_open()</a>, <a class="el" href="dbus-userdb_8c_source.html#l00623">_dbus_user_database_unref()</a>, <a class="el" href="dbus-userdb_8c_source.html#l00076">_dbus_user_info_free()</a>, <a class="el" href="dbus-userdb_8c_source.html#l00045">_dbus_user_info_free_allocated()</a>, <a class="el" href="dbus-watch_8c_source.html#l00249">_dbus_watch_list_free()</a>, <a class="el" href="dbus-watch_8c_source.html#l00138">_dbus_watch_unref()</a>, <a class="el" href="dbus-address_8c_source.html#l00189">dbus_address_entries_free()</a>, <a class="el" href="dbus-connection_8c_source.html#l03191">dbus_connection_free_preallocated_send()</a>, <a class="el" href="dbus-errors_8c_source.html#l00211">dbus_error_free()</a>, <a class="el" href="dbus-memory_8c_source.html#l00749">dbus_free_string_array()</a>, <a class="el" href="dbus-message_8c_source.html#l01587">dbus_message_copy()</a>, <a class="el" href="dbus-address_8c_source.html#l00363">dbus_parse_address()</a>, <a class="el" href="dbus-memory_8c_source.html#l00601">dbus_realloc()</a>, <a class="el" href="dbus-errors_8c_source.html#l00354">dbus_set_error()</a>, and <a class="el" href="dbus-memory_8c_source.html#l00890">dbus_shutdown()</a>.</p>
</div>
</div>
<a class="anchor" id="gac200b2dbc8b3f6ecac4d42426fb97b40"></a><!-- doxytag: member="dbus-memory.c::dbus_free_string_array" ref="gac200b2dbc8b3f6ecac4d42426fb97b40" args="(char **str_array)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DBUS_EXPORT void <a class="el" href="group__DBusMemory.html#gac200b2dbc8b3f6ecac4d42426fb97b40">dbus_free_string_array</a> </td>
<td>(</td>
<td class="paramtype">char ** </td>
<td class="paramname"><em>str_array</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Frees a <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>-terminated array of strings. </p>
<p>If passed <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, does nothing.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">str_array</td><td>the array to be freed </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="dbus-memory_8c_source.html#l00749">749</a> of file <a class="el" href="dbus-memory_8c_source.html">dbus-memory.c</a>.</p>
<p>References <a class="el" href="dbus-memory_8c_source.html#l00701">dbus_free()</a>.</p>
<p>Referenced by <a class="el" href="dbus-auth_8c_source.html#l02396">_dbus_auth_set_mechanisms()</a>, <a class="el" href="dbus-auth_8c_source.html#l02346">_dbus_auth_unref()</a>, <a class="el" href="dbus-object-tree_8c_source.html#l01242">_dbus_decompose_path()</a>, <a class="el" href="dbus-internals_8c_source.html#l00578">_dbus_dup_string_array()</a>, <a class="el" href="dbus-sysdeps-util_8c_source.html#l00049">_dbus_get_environment()</a>, <a class="el" href="dbus-message_8c_source.html#l00796">_dbus_message_iter_get_args_valist()</a>, <a class="el" href="dbus-object-tree_8c_source.html#l00903">_dbus_object_tree_dispatch_and_unlock()</a>, <a class="el" href="dbus-server_8c_source.html#l00193">_dbus_server_finalize_base()</a>, <a class="el" href="dbus-spawn_8c_source.html#l01194">_dbus_spawn_async_with_babysitter()</a>, <a class="el" href="dbus-transport-unix_8c_source.html#l00225">_dbus_transport_open_platform_specific()</a>, <a class="el" href="dbus-connection_8c_source.html#l05841">dbus_connection_get_object_path_data()</a>, <a class="el" href="dbus-connection_8c_source.html#l05878">dbus_connection_list_registered()</a>, <a class="el" href="dbus-connection_8c_source.html#l05809">dbus_connection_unregister_object_path()</a>, and <a class="el" href="dbus-server_8c_source.html#l01033">dbus_server_set_auth_mechanisms()</a>.</p>
</div>
</div>
<a class="anchor" id="gaf6e588659067a854c3cca7ebe8ae5084"></a><!-- doxytag: member="dbus-memory.c::dbus_malloc" ref="gaf6e588659067a854c3cca7ebe8ae5084" args="(size_t bytes)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DBUS_EXPORT DBUS_MALLOC void * <a class="el" href="group__DBusMemory.html#gaf6e588659067a854c3cca7ebe8ae5084">dbus_malloc</a> </td>
<td>(</td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>bytes</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Allocates the given number of bytes, as with standard malloc(). </p>
<p>Guaranteed to return <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if bytes is zero on all platforms. Returns <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if the allocation fails. The memory must be released with <a class="el" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a" title="Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().">dbus_free()</a>.</p>
<p><a class="el" href="group__DBusMemory.html#gaf6e588659067a854c3cca7ebe8ae5084" title="Allocates the given number of bytes, as with standard malloc().">dbus_malloc()</a> memory is NOT safe to free with regular free() from the C library. Free it with <a class="el" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a" title="Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().">dbus_free()</a> only.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">bytes</td><td>number of bytes to allocate </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>allocated memory, or <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if the allocation fails. </dd></dl>
<p>Definition at line <a class="el" href="dbus-memory_8c_source.html#l00461">461</a> of file <a class="el" href="dbus-memory_8c_source.html">dbus-memory.c</a>.</p>
<p>References <a class="el" href="dbus-sysdeps_8c_source.html#l00077">_dbus_abort()</a>, <a class="el" href="dbus-sysdeps-unix_8c_source.html#l02501">_dbus_atomic_inc()</a>, <a class="el" href="dbus-internals_8c_source.html#l00230">_dbus_warn()</a>, and <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.</p>
<p>Referenced by <a class="el" href="dbus-mempool_8c_source.html#l00214">_dbus_mem_pool_alloc()</a>, <a class="el" href="dbus-internals_8c_source.html#l00555">_dbus_memdup()</a>, <a class="el" href="dbus-sysdeps-unix_8c_source.html#l03184">_dbus_printf_string_upper_bound()</a>, <a class="el" href="dbus-internals_8c_source.html#l00527">_dbus_strdup()</a>, <a class="el" href="dbus-string_8c_source.html#l00655">_dbus_string_copy_data()</a>, and <a class="el" href="dbus-string_8c_source.html#l00132">_dbus_string_init_preallocated()</a>.</p>
</div>
</div>
<a class="anchor" id="gaa02722b030a091f6c14c4cb11a593623"></a><!-- doxytag: member="dbus-memory.c::dbus_malloc0" ref="gaa02722b030a091f6c14c4cb11a593623" args="(size_t bytes)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DBUS_EXPORT DBUS_MALLOC void * <a class="el" href="group__DBusMemory.html#gaa02722b030a091f6c14c4cb11a593623">dbus_malloc0</a> </td>
<td>(</td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>bytes</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Allocates the given number of bytes, as with standard malloc(), but all bytes are initialized to zero as with calloc(). </p>
<p>Guaranteed to return <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if bytes is zero on all platforms. Returns <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if the allocation fails. The memory must be released with <a class="el" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a" title="Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().">dbus_free()</a>.</p>
<p><a class="el" href="group__DBusMemory.html#gaa02722b030a091f6c14c4cb11a593623" title="Allocates the given number of bytes, as with standard malloc(), but all bytes are initialized to zero...">dbus_malloc0()</a> memory is NOT safe to free with regular free() from the C library. Free it with <a class="el" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a" title="Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().">dbus_free()</a> only.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">bytes</td><td>number of bytes to allocate </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>allocated memory, or <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if the allocation fails. </dd></dl>
<p>Definition at line <a class="el" href="dbus-memory_8c_source.html#l00531">531</a> of file <a class="el" href="dbus-memory_8c_source.html">dbus-memory.c</a>.</p>
<p>References <a class="el" href="dbus-sysdeps_8c_source.html#l00077">_dbus_abort()</a>, <a class="el" href="dbus-sysdeps-unix_8c_source.html#l02501">_dbus_atomic_inc()</a>, <a class="el" href="dbus-internals_8c_source.html#l00230">_dbus_warn()</a>, and <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.</p>
<p>Referenced by <a class="el" href="dbus-mempool_8c_source.html#l00214">_dbus_mem_pool_alloc()</a>.</p>
</div>
</div>
<a class="anchor" id="ga2d505f2960ccf343042d363170b27f9c"></a><!-- doxytag: member="dbus-memory.c::dbus_realloc" ref="ga2d505f2960ccf343042d363170b27f9c" args="(void *memory, size_t bytes)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DBUS_EXPORT DBUS_MALLOC void * <a class="el" href="group__DBusMemory.html#ga2d505f2960ccf343042d363170b27f9c">dbus_realloc</a> </td>
<td>(</td>
<td class="paramtype">void * </td>
<td class="paramname"><em>memory</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>bytes</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Resizes a block of memory previously allocated by <a class="el" href="group__DBusMemory.html#gaf6e588659067a854c3cca7ebe8ae5084" title="Allocates the given number of bytes, as with standard malloc().">dbus_malloc()</a> or <a class="el" href="group__DBusMemory.html#gaa02722b030a091f6c14c4cb11a593623" title="Allocates the given number of bytes, as with standard malloc(), but all bytes are initialized to zero...">dbus_malloc0()</a>. </p>
<p>Guaranteed to free the memory and return <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if bytes is zero on all platforms. Returns <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if the resize fails. If the resize fails, the memory is not freed.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">memory</td><td>block to be resized </td></tr>
<tr><td class="paramname">bytes</td><td>new size of the memory block </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>allocated memory, or <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if the resize fails. </dd></dl>
<p>Definition at line <a class="el" href="dbus-memory_8c_source.html#l00601">601</a> of file <a class="el" href="dbus-memory_8c_source.html">dbus-memory.c</a>.</p>
<p>References <a class="el" href="dbus-sysdeps_8c_source.html#l00077">_dbus_abort()</a>, <a class="el" href="dbus-sysdeps-unix_8c_source.html#l02501">_dbus_atomic_inc()</a>, <a class="el" href="dbus-internals_8c_source.html#l00230">_dbus_warn()</a>, <a class="el" href="dbus-memory_8c_source.html#l00701">dbus_free()</a>, <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1">FALSE</a>, and <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.</p>
<p>Referenced by <a class="el" href="dbus-dataslot_8c_source.html#l00069">_dbus_data_slot_allocator_alloc()</a>, <a class="el" href="dbus-dataslot_8c_source.html#l00221">_dbus_data_slot_list_set()</a>, <a class="el" href="dbus-sysdeps-unix_8c_source.html#l01378">_dbus_listen_tcp_socket()</a>, and <a class="el" href="dbus-message_8c_source.html#l04002">_dbus_message_loader_get_unix_fds()</a>.</p>
</div>
</div>
<a class="anchor" id="ga01912903e39428872920d861ef565bac"></a><!-- doxytag: member="dbus-memory.c::dbus_shutdown" ref="ga01912903e39428872920d861ef565bac" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DBUS_EXPORT void <a class="el" href="group__DBusMemory.html#ga01912903e39428872920d861ef565bac">dbus_shutdown</a> </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Frees all memory allocated internally by libdbus and reverses the effects of <a class="el" href="group__DBusThreads.html#gac7b8a7001befc3eaa8c6b043151008dc" title="Initializes threads, like dbus_threads_init_default().">dbus_threads_init()</a>. </p>
<p>libdbus keeps internal global variables, for example caches and thread locks, and it can be useful to free these internal data structures.</p>
<p><a class="el" href="group__DBusMemory.html#ga01912903e39428872920d861ef565bac" title="Frees all memory allocated internally by libdbus and reverses the effects of dbus_threads_init().">dbus_shutdown()</a> does NOT free memory that was returned to the application. It only frees libdbus-internal data structures.</p>
<p>You MUST free all memory and release all reference counts returned to you by libdbus prior to calling <a class="el" href="group__DBusMemory.html#ga01912903e39428872920d861ef565bac" title="Frees all memory allocated internally by libdbus and reverses the effects of dbus_threads_init().">dbus_shutdown()</a>.</p>
<p>You can't continue to use any D-Bus objects, such as connections, that were allocated prior to <a class="el" href="group__DBusMemory.html#ga01912903e39428872920d861ef565bac" title="Frees all memory allocated internally by libdbus and reverses the effects of dbus_threads_init().">dbus_shutdown()</a>. You can, however, start over; call <a class="el" href="group__DBusThreads.html#gac7b8a7001befc3eaa8c6b043151008dc" title="Initializes threads, like dbus_threads_init_default().">dbus_threads_init()</a> again, create new connections, and so forth.</p>
<p>WARNING: <a class="el" href="group__DBusMemory.html#ga01912903e39428872920d861ef565bac" title="Frees all memory allocated internally by libdbus and reverses the effects of dbus_threads_init().">dbus_shutdown()</a> is NOT thread safe, it must be called while NO other threads are using D-Bus. (Remember, you have to free all D-Bus objects and memory before you call <a class="el" href="group__DBusMemory.html#ga01912903e39428872920d861ef565bac" title="Frees all memory allocated internally by libdbus and reverses the effects of dbus_threads_init().">dbus_shutdown()</a>, so no thread can be using libdbus.)</p>
<p>The purpose of <a class="el" href="group__DBusMemory.html#ga01912903e39428872920d861ef565bac" title="Frees all memory allocated internally by libdbus and reverses the effects of dbus_threads_init().">dbus_shutdown()</a> is to allow applications to get clean output from memory leak checkers. <a class="el" href="group__DBusMemory.html#ga01912903e39428872920d861ef565bac" title="Frees all memory allocated internally by libdbus and reverses the effects of dbus_threads_init().">dbus_shutdown()</a> may also be useful if you want to dlopen() libdbus instead of linking to it, and want to be able to unload the library again.</p>
<p>There is absolutely no requirement to call <a class="el" href="group__DBusMemory.html#ga01912903e39428872920d861ef565bac" title="Frees all memory allocated internally by libdbus and reverses the effects of dbus_threads_init().">dbus_shutdown()</a> - in fact, most applications won't bother and should not feel guilty.</p>
<p>You have to know that nobody is using libdbus in your application's process before you can call <a class="el" href="group__DBusMemory.html#ga01912903e39428872920d861ef565bac" title="Frees all memory allocated internally by libdbus and reverses the effects of dbus_threads_init().">dbus_shutdown()</a>. One implication of this is that calling <a class="el" href="group__DBusMemory.html#ga01912903e39428872920d861ef565bac" title="Frees all memory allocated internally by libdbus and reverses the effects of dbus_threads_init().">dbus_shutdown()</a> from a library is almost certainly wrong, since you don't know what the rest of the app is up to. </p>
<p>Definition at line <a class="el" href="dbus-memory_8c_source.html#l00890">890</a> of file <a class="el" href="dbus-memory_8c_source.html">dbus-memory.c</a>.</p>
<p>References <a class="el" href="dbus-sysdeps-pthread_8c_source.html#l00292">_dbus_threads_lock_platform_specific()</a>, <a class="el" href="dbus-sysdeps-pthread_8c_source.html#l00298">_dbus_threads_unlock_platform_specific()</a>, <a class="el" href="dbus-memory_8c_source.html#l00795">ShutdownClosure::data</a>, <a class="el" href="dbus-memory_8c_source.html#l00701">dbus_free()</a>, <a class="el" href="dbus-memory_8c_source.html#l00794">ShutdownClosure::func</a>, <a class="el" href="dbus-memory_8c_source.html#l00793">ShutdownClosure::next</a>, and <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.</p>
</div>
</div>
</div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Mar 3 2016 17:50:33 for D-Bus by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>