KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /usr/share/devhelp/books/dbus/api/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/devhelp/books/dbus/api/group__DBusMemory.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>D-Bus: Memory Allocation</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul></div>
<h1>Memory Allocation<br>
<small>
[<a class="el" href="group__DBus.html">D-Bus low-level public API</a>]</small>
</h1><a class="el" href="group__DBusMemory.html#g0fff22bd7f055f5581a9898116a744b1">dbus_malloc()</a>, <a class="el" href="group__DBusMemory.html#g488c6b08cc8c1ddf0203243c4b27a13c">dbus_free()</a>, etc.  
<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#g54ccb556e7964112a825a7f46c156ca0">dbus_new</a>(type, count)&nbsp;&nbsp;&nbsp;((type*)dbus_malloc (sizeof (type) * (count)));</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Safe macro for using <a class="el" href="group__DBusMemory.html#g0fff22bd7f055f5581a9898116a744b1">dbus_malloc()</a>.  <a href="#g54ccb556e7964112a825a7f46c156ca0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#gba9d823abda7f4cadbaf5177d3b8b793">dbus_new0</a>(type, count)&nbsp;&nbsp;&nbsp;((type*)dbus_malloc0 (sizeof (type) * (count)));</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Safe macro for using <a class="el" href="group__DBusMemory.html#g36292df79461a45f8d1e27d05daf704f">dbus_malloc0()</a>.  <a href="#gba9d823abda7f4cadbaf5177d3b8b793"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef void(*)&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#g8792ec2b2b8626ca28022faf51ec415a">DBusFreeFunction</a> (void *memory)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The type of a function which frees a block of memory.  <a href="#g8792ec2b2b8626ca28022faf51ec415a"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#g0fff22bd7f055f5581a9898116a744b1">dbus_malloc</a> (size_t bytes)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocates the given number of bytes, as with standard malloc().  <a href="#g0fff22bd7f055f5581a9898116a744b1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#g36292df79461a45f8d1e27d05daf704f">dbus_malloc0</a> (size_t bytes)</td></tr>

<tr><td class="mdescLeft">&nbsp;</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="#g36292df79461a45f8d1e27d05daf704f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#g621d9ba15ea8ae44501b0fbf756cbeac">dbus_realloc</a> (void *memory, size_t bytes)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Resizes a block of memory previously allocated by <a class="el" href="group__DBusMemory.html#g0fff22bd7f055f5581a9898116a744b1">dbus_malloc()</a> or <a class="el" href="group__DBusMemory.html#g36292df79461a45f8d1e27d05daf704f">dbus_malloc0()</a>.  <a href="#g621d9ba15ea8ae44501b0fbf756cbeac"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#g488c6b08cc8c1ddf0203243c4b27a13c">dbus_free</a> (void *memory)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Frees a block of memory previously allocated by <a class="el" href="group__DBusMemory.html#g0fff22bd7f055f5581a9898116a744b1">dbus_malloc()</a> or <a class="el" href="group__DBusMemory.html#g36292df79461a45f8d1e27d05daf704f">dbus_malloc0()</a>.  <a href="#g488c6b08cc8c1ddf0203243c4b27a13c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#g6d4674de64d806d238ffd309a486754e">dbus_free_string_array</a> (char **str_array)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Frees a <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>-terminated array of strings.  <a href="#g6d4674de64d806d238ffd309a486754e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusMemory.html#g8b177950791eebaefc7dc1e836c0964c">dbus_shutdown</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Frees all memory allocated internally by libdbus and reverses the effects of <a class="el" href="group__DBusThreads.html#ga9a4ed445c77af3afa0dbdbb9d85afd4">dbus_threads_init()</a>.  <a href="#g8b177950791eebaefc7dc1e836c0964c"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<a class="el" href="group__DBusMemory.html#g0fff22bd7f055f5581a9898116a744b1">dbus_malloc()</a>, <a class="el" href="group__DBusMemory.html#g488c6b08cc8c1ddf0203243c4b27a13c">dbus_free()</a>, etc. 
<p>
Functions and macros related to allocating and releasing blocks of memory. <hr><h2>Define Documentation</h2>
<a class="anchor" name="g54ccb556e7964112a825a7f46c156ca0"></a><!-- doxytag: member="dbus-memory.h::dbus_new" ref="g54ccb556e7964112a825a7f46c156ca0" args="(type, count)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dbus_new          </td>
          <td>(</td>
          <td class="paramtype">type,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">count&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%">&nbsp;&nbsp;&nbsp;((type*)dbus_malloc (sizeof (type) * (count)));</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Safe macro for using <a class="el" href="group__DBusMemory.html#g0fff22bd7f055f5581a9898116a744b1">dbus_malloc()</a>. 
<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 compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>type</em>&nbsp;</td><td>type name to allocate </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>count</em>&nbsp;</td><td>number of instances in the allocated array </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>the new memory block or <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> on failure </dd></dl>

<p>
Definition at line <a class="el" href="dbus-memory_8h-source.html#l00046">46</a> of file <a class="el" href="dbus-memory_8h-source.html">dbus-memory.h</a>.
<p>
Referenced by <a class="el" href="dbus-resources_8c-source.html#l00077">_dbus_counter_new()</a>, <a class="el" href="dbus-credentials_8c-source.html#l00068">_dbus_credentials_new()</a>, <a class="el" href="dbus-userdb-util_8c-source.html#l00354">_dbus_groups_from_uid()</a>, <a class="el" href="dbus-memory_8c-source.html#l00716">_dbus_register_shutdown_func()</a>, <a class="el" href="dbus-server-socket_8c-source.html#l00266">_dbus_server_new_for_socket()</a>, and <a class="el" href="dbus-address_8c-source.html#l00363">dbus_parse_address()</a>.
</div>
</div><p>
<a class="anchor" name="gba9d823abda7f4cadbaf5177d3b8b793"></a><!-- doxytag: member="dbus-memory.h::dbus_new0" ref="gba9d823abda7f4cadbaf5177d3b8b793" args="(type, count)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define dbus_new0          </td>
          <td>(</td>
          <td class="paramtype">type,         <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">count&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%">&nbsp;&nbsp;&nbsp;((type*)dbus_malloc0 (sizeof (type) * (count)));</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Safe macro for using <a class="el" href="group__DBusMemory.html#g36292df79461a45f8d1e27d05daf704f">dbus_malloc0()</a>. 
<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 compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>type</em>&nbsp;</td><td>type name to allocate </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>count</em>&nbsp;</td><td>number of instances in the allocated array </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>the new memory block or <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> on failure </dd></dl>

<p>
Definition at line <a class="el" href="dbus-memory_8h-source.html#l00047">47</a> of file <a class="el" href="dbus-memory_8h-source.html">dbus-memory.h</a>.
<p>
Referenced by <a class="el" href="dbus-connection_8c-source.html#l01163">_dbus_connection_new_for_transport()</a>, <a class="el" href="dbus-object-tree_8c-source.html#l01058">_dbus_decompose_path()</a>, <a class="el" href="dbus-sysdeps-util-unix_8c-source.html#l00590">_dbus_directory_open()</a>, <a class="el" href="dbus-internals_8c-source.html#l00447">_dbus_dup_string_array()</a>, <a class="el" href="dbus-hash_8c-source.html#l00292">_dbus_hash_table_new()</a>, <a class="el" href="dbus-mempool_8c-source.html#l00136">_dbus_mem_pool_new()</a>, <a class="el" href="dbus-message_8c-source.html#l00641">_dbus_message_iter_get_args_valist()</a>, <a class="el" href="dbus-message_8c-source.html#l03304">_dbus_message_loader_new()</a>, <a class="el" href="dbus-object-tree_8c-source.html#l00090">_dbus_object_tree_new()</a>, <a class="el" href="dbus-pending-call_8c-source.html#l00091">_dbus_pending_call_new_unlocked()</a>, <a class="el" href="dbus-server-socket_8c-source.html#l00266">_dbus_server_new_for_socket()</a>, <a class="el" href="dbus-timeout_8c-source.html#l00193">_dbus_timeout_list_new()</a>, <a class="el" href="dbus-timeout_8c-source.html#l00062">_dbus_timeout_new()</a>, <a class="el" href="dbus-transport-socket_8c-source.html#l01148">_dbus_transport_new_for_socket()</a>, <a class="el" href="dbus-userdb_8c-source.html#l00127">_dbus_user_database_lookup()</a>, <a class="el" href="dbus-userdb-util_8c-source.html#l00208">_dbus_user_database_lookup_group()</a>, <a class="el" href="dbus-userdb_8c-source.html#l00530">_dbus_user_database_new()</a>, <a class="el" href="dbus-watch_8c-source.html#l00208">_dbus_watch_list_new()</a>, <a class="el" href="dbus-watch_8c-source.html#l00067">_dbus_watch_new()</a>, <a class="el" href="dbus-connection_8c-source.html#l05160">dbus_connection_add_filter()</a>, <a class="el" href="dbus-message_8c-source.html#l01311">dbus_message_copy()</a>, and <a class="el" href="dbus-address_8c-source.html#l00363">dbus_parse_address()</a>.
</div>
</div><p>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="g8792ec2b2b8626ca28022faf51ec415a"></a><!-- doxytag: member="dbus-memory.h::DBusFreeFunction" ref="g8792ec2b2b8626ca28022faf51ec415a" args="(void *memory)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__DBusMemory.html#g8792ec2b2b8626ca28022faf51ec415a">DBusFreeFunction</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
The type of a function which frees a block of memory. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>memory</em>&nbsp;</td><td>the memory to free </td></tr>
  </table>
</dl>

<p>
Definition at line <a class="el" href="dbus-memory_8h-source.html#l00051">51</a> of file <a class="el" href="dbus-memory_8h-source.html">dbus-memory.h</a>.
</div>
</div><p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="g488c6b08cc8c1ddf0203243c4b27a13c"></a><!-- doxytag: member="dbus-memory.c::dbus_free" ref="g488c6b08cc8c1ddf0203243c4b27a13c" args="(void *memory)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dbus_free           </td>
          <td>(</td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>memory</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Frees a block of memory previously allocated by <a class="el" href="group__DBusMemory.html#g0fff22bd7f055f5581a9898116a744b1">dbus_malloc()</a> or <a class="el" href="group__DBusMemory.html#g36292df79461a45f8d1e27d05daf704f">dbus_malloc0()</a>. 
<p>
If passed <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, does nothing.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>memory</em>&nbsp;</td><td>block to be freed </td></tr>
  </table>
</dl>

<p>
Definition at line <a class="el" href="dbus-memory_8c-source.html#l00617">617</a> of file <a class="el" href="dbus-memory_8c-source.html">dbus-memory.c</a>.
<p>
References <a class="el" href="dbus-internals_8h-source.html#l00109">_dbus_assert</a>, <a class="el" href="dbus-sysdeps-unix_8c-source.html#l01792">_dbus_atomic_dec()</a>, and <a class="el" href="group__DBusMacros.html#ga8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>.
<p>
Referenced by <a class="el" href="dbus-auth_8c-source.html#l02243">_dbus_auth_unref()</a>, <a class="el" href="dbus-spawn_8c-source.html#l00264">_dbus_babysitter_unref()</a>, <a class="el" href="dbus-connection_8c-source.html#l01163">_dbus_connection_new_for_transport()</a>, <a class="el" href="dbus-resources_8c-source.html#l00118">_dbus_counter_unref()</a>, <a class="el" href="dbus-credentials_8c-source.html#l00175">_dbus_credentials_add_windows_sid()</a>, <a class="el" href="dbus-credentials_8c-source.html#l00374">_dbus_credentials_clear()</a>, <a class="el" href="dbus-credentials_8c-source.html#l00124">_dbus_credentials_unref()</a>, <a class="el" href="dbus-dataslot_8c-source.html#l00163">_dbus_data_slot_allocator_free()</a>, <a class="el" href="dbus-dataslot_8c-source.html#l00348">_dbus_data_slot_list_free()</a>, <a class="el" href="dbus-sysdeps-util-unix_8c-source.html#l00741">_dbus_directory_close()</a>, <a class="el" href="dbus-sysdeps-util-unix_8c-source.html#l00678">_dbus_directory_get_next_file()</a>, <a class="el" href="dbus-userdb_8c-source.html#l00088">_dbus_group_info_free()</a>, <a class="el" href="dbus-userdb_8c-source.html#l00060">_dbus_group_info_free_allocated()</a>, <a class="el" href="dbus-hash_8c-source.html#l00292">_dbus_hash_table_new()</a>, <a class="el" href="dbus-hash_8c-source.html#l00374">_dbus_hash_table_unref()</a>, <a class="el" href="dbus-keyring_8c-source.html#l00685">_dbus_keyring_unref()</a>, <a class="el" href="dbus-sysdeps-unix_8c-source.html#l00854">_dbus_listen_tcp_socket()</a>, <a class="el" href="dbus-mempool_8c-source.html#l00336">_dbus_mem_pool_dealloc()</a>, <a class="el" href="dbus-mempool_8c-source.html#l00183">_dbus_mem_pool_free()</a>, <a class="el" href="dbus-message_8c-source.html#l03304">_dbus_message_loader_new()</a>, <a class="el" href="dbus-message_8c-source.html#l03354">_dbus_message_loader_unref()</a>, <a class="el" href="dbus-object-tree_8c-source.html#l00090">_dbus_object_tree_new()</a>, <a class="el" href="dbus-object-tree_8c-source.html#l00141">_dbus_object_tree_unref()</a>, <a class="el" href="dbus-pending-call_8c-source.html#l00091">_dbus_pending_call_new_unlocked()</a>, <a class="el" href="dbus-server_8c-source.html#l00168">_dbus_server_finalize_base()</a>, <a class="el" href="dbus-server_8c-source.html#l00096">_dbus_server_init_base()</a>, <a class="el" href="dbus-server-unix_8c-source.html#l00167">_dbus_server_new_for_domain_socket()</a>, <a class="el" href="dbus-server-socket_8c-source.html#l00369">_dbus_server_new_for_tcp_socket()</a>, <a class="el" href="dbus-sysdeps_8c-source.html#l00259">_dbus_split_paths_and_append()</a>, <a class="el" href="dbus-string_8c-source.html#l00262">_dbus_string_free()</a>, <a class="el" href="dbus-timeout_8c-source.html#l00210">_dbus_timeout_list_free()</a>, <a class="el" href="dbus-timeout_8c-source.html#l00106">_dbus_timeout_unref()</a>, <a class="el" href="dbus-transport_8c-source.html#l00202">_dbus_transport_finalize_base()</a>, <a class="el" href="dbus-transport-socket_8c-source.html#l01148">_dbus_transport_new_for_socket()</a>, <a class="el" href="dbus-transport_8c-source.html#l00350">_dbus_transport_open()</a>, <a class="el" href="dbus-userdb_8c-source.html#l00603">_dbus_user_database_unref()</a>, <a class="el" href="dbus-userdb_8c-source.html#l00075">_dbus_user_info_free()</a>, <a class="el" href="dbus-userdb_8c-source.html#l00044">_dbus_user_info_free_allocated()</a>, <a class="el" href="dbus-watch_8c-source.html#l00225">_dbus_watch_list_free()</a>, <a class="el" href="dbus-watch_8c-source.html#l00117">_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#l02956">dbus_connection_free_preallocated_send()</a>, <a class="el" href="dbus-errors_8c-source.html#l00183">dbus_error_free()</a>, <a class="el" href="dbus-memory_8c-source.html#l00655">dbus_free_string_array()</a>, <a class="el" href="dbus-message_8c-source.html#l01311">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#l00544">dbus_realloc()</a>, <a class="el" href="dbus-errors_8c-source.html#l00326">dbus_set_error()</a>, and <a class="el" href="dbus-memory_8c-source.html#l00786">dbus_shutdown()</a>.
</div>
</div><p>
<a class="anchor" name="g6d4674de64d806d238ffd309a486754e"></a><!-- doxytag: member="dbus-memory.c::dbus_free_string_array" ref="g6d4674de64d806d238ffd309a486754e" args="(char **str_array)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dbus_free_string_array           </td>
          <td>(</td>
          <td class="paramtype">char **&nbsp;</td>
          <td class="paramname"> <em>str_array</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Frees a <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>-terminated array of strings. 
<p>
If passed <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>, does nothing.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>str_array</em>&nbsp;</td><td>the array to be freed </td></tr>
  </table>
</dl>

<p>
Definition at line <a class="el" href="dbus-memory_8c-source.html#l00655">655</a> of file <a class="el" href="dbus-memory_8c-source.html">dbus-memory.c</a>.
<p>
References <a class="el" href="dbus-memory_8c-source.html#l00617">dbus_free()</a>.
<p>
Referenced by <a class="el" href="dbus-auth_8c-source.html#l02293">_dbus_auth_set_mechanisms()</a>, <a class="el" href="dbus-auth_8c-source.html#l02243">_dbus_auth_unref()</a>, <a class="el" href="dbus-object-tree_8c-source.html#l01058">_dbus_decompose_path()</a>, <a class="el" href="dbus-internals_8c-source.html#l00447">_dbus_dup_string_array()</a>, <a class="el" href="dbus-message_8c-source.html#l00641">_dbus_message_iter_get_args_valist()</a>, <a class="el" href="dbus-object-tree_8c-source.html#l00731">_dbus_object_tree_dispatch_and_unlock()</a>, <a class="el" href="dbus-server_8c-source.html#l00168">_dbus_server_finalize_base()</a>, <a class="el" href="dbus-connection_8c-source.html#l05391">dbus_connection_get_object_path_data()</a>, <a class="el" href="dbus-connection_8c-source.html#l05428">dbus_connection_list_registered()</a>, <a class="el" href="dbus-connection_8c-source.html#l05319">dbus_connection_register_fallback()</a>, <a class="el" href="dbus-connection_8c-source.html#l05276">dbus_connection_register_object_path()</a>, <a class="el" href="dbus-connection_8c-source.html#l05359">dbus_connection_unregister_object_path()</a>, and <a class="el" href="dbus-server_8c-source.html#l01003">dbus_server_set_auth_mechanisms()</a>.
</div>
</div><p>
<a class="anchor" name="g0fff22bd7f055f5581a9898116a744b1"></a><!-- doxytag: member="dbus-memory.c::dbus_malloc" ref="g0fff22bd7f055f5581a9898116a744b1" args="(size_t bytes)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void * dbus_malloc           </td>
          <td>(</td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>bytes</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Allocates the given number of bytes, as with standard malloc(). 
<p>
Guaranteed to return <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> if bytes is zero on all platforms. Returns <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> if the allocation fails. The memory must be released with <a class="el" href="group__DBusMemory.html#g488c6b08cc8c1ddf0203243c4b27a13c">dbus_free()</a>.<p>
<a class="el" href="group__DBusMemory.html#g0fff22bd7f055f5581a9898116a744b1">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#g488c6b08cc8c1ddf0203243c4b27a13c">dbus_free()</a> only.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>bytes</em>&nbsp;</td><td>number of bytes to allocate </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>allocated memory, or <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> if the allocation fails. </dd></dl>

<p>
Definition at line <a class="el" href="dbus-memory_8c-source.html#l00440">440</a> of file <a class="el" href="dbus-memory_8c-source.html">dbus-memory.c</a>.
<p>
References <a class="el" href="dbus-sysdeps-unix_8c-source.html#l01769">_dbus_atomic_inc()</a>, and <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.
<p>
Referenced by <a class="el" href="dbus-sysdeps-util-unix_8c-source.html#l00678">_dbus_directory_get_next_file()</a>, <a class="el" href="dbus-mempool_8c-source.html#l00208">_dbus_mem_pool_alloc()</a>, <a class="el" href="dbus-internals_8c-source.html#l00424">_dbus_memdup()</a>, <a class="el" href="dbus-internals_8c-source.html#l00396">_dbus_strdup()</a>, <a class="el" href="dbus-string_8c-source.html#l00697">_dbus_string_copy_data()</a>, and <a class="el" href="dbus-string_8c-source.html#l00131">_dbus_string_init_preallocated()</a>.
</div>
</div><p>
<a class="anchor" name="g36292df79461a45f8d1e27d05daf704f"></a><!-- doxytag: member="dbus-memory.c::dbus_malloc0" ref="g36292df79461a45f8d1e27d05daf704f" args="(size_t bytes)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void * dbus_malloc0           </td>
          <td>(</td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>bytes</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></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>
Guaranteed to return <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> if bytes is zero on all platforms. Returns <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> if the allocation fails. The memory must be released with <a class="el" href="group__DBusMemory.html#g488c6b08cc8c1ddf0203243c4b27a13c">dbus_free()</a>.<p>
<a class="el" href="group__DBusMemory.html#g36292df79461a45f8d1e27d05daf704f">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#g488c6b08cc8c1ddf0203243c4b27a13c">dbus_free()</a> only.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>bytes</em>&nbsp;</td><td>number of bytes to allocate </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>allocated memory, or <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> if the allocation fails. </dd></dl>

<p>
Definition at line <a class="el" href="dbus-memory_8c-source.html#l00493">493</a> of file <a class="el" href="dbus-memory_8c-source.html">dbus-memory.c</a>.
<p>
References <a class="el" href="dbus-sysdeps-unix_8c-source.html#l01769">_dbus_atomic_inc()</a>, and <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.
<p>
Referenced by <a class="el" href="dbus-mempool_8c-source.html#l00208">_dbus_mem_pool_alloc()</a>.
</div>
</div><p>
<a class="anchor" name="g621d9ba15ea8ae44501b0fbf756cbeac"></a><!-- doxytag: member="dbus-memory.c::dbus_realloc" ref="g621d9ba15ea8ae44501b0fbf756cbeac" args="(void *memory, size_t bytes)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void * dbus_realloc           </td>
          <td>(</td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>memory</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>bytes</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Resizes a block of memory previously allocated by <a class="el" href="group__DBusMemory.html#g0fff22bd7f055f5581a9898116a744b1">dbus_malloc()</a> or <a class="el" href="group__DBusMemory.html#g36292df79461a45f8d1e27d05daf704f">dbus_malloc0()</a>. 
<p>
Guaranteed to free the memory and return <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> if bytes is zero on all platforms. Returns <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> if the resize fails. If the resize fails, the memory is not freed.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>memory</em>&nbsp;</td><td>block to be resized </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>bytes</em>&nbsp;</td><td>new size of the memory block </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>allocated memory, or <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> if the resize fails. </dd></dl>

<p>
Definition at line <a class="el" href="dbus-memory_8c-source.html#l00544">544</a> of file <a class="el" href="dbus-memory_8c-source.html">dbus-memory.c</a>.
<p>
References <a class="el" href="dbus-sysdeps-unix_8c-source.html#l01769">_dbus_atomic_inc()</a>, <a class="el" href="dbus-memory_8c-source.html#l00617">dbus_free()</a>, <a class="el" href="group__DBusMacros.html#ga93f0eb578d23995850d61f7d61c55c1">FALSE</a>, and <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.
<p>
Referenced by <a class="el" href="dbus-dataslot_8c-source.html#l00067">_dbus_data_slot_allocator_alloc()</a>, <a class="el" href="dbus-dataslot_8c-source.html#l00235">_dbus_data_slot_list_set()</a>, and <a class="el" href="dbus-sysdeps-unix_8c-source.html#l00854">_dbus_listen_tcp_socket()</a>.
</div>
</div><p>
<a class="anchor" name="g8b177950791eebaefc7dc1e836c0964c"></a><!-- doxytag: member="dbus-memory.c::dbus_shutdown" ref="g8b177950791eebaefc7dc1e836c0964c" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dbus_shutdown           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></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#ga9a4ed445c77af3afa0dbdbb9d85afd4">dbus_threads_init()</a>. 
<p>
libdbus keeps internal global variables, for example caches and thread locks, and it can be useful to free these internal data structures.<p>
<a class="el" href="group__DBusMemory.html#g8b177950791eebaefc7dc1e836c0964c">dbus_shutdown()</a> does NOT free memory that was returned to the application. It only returns libdbus-internal data structures.<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#g8b177950791eebaefc7dc1e836c0964c">dbus_shutdown()</a>.<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#g8b177950791eebaefc7dc1e836c0964c">dbus_shutdown()</a>. You can, however, start over; call <a class="el" href="group__DBusThreads.html#ga9a4ed445c77af3afa0dbdbb9d85afd4">dbus_threads_init()</a> again, create new connections, and so forth.<p>
WARNING: <a class="el" href="group__DBusMemory.html#g8b177950791eebaefc7dc1e836c0964c">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#g8b177950791eebaefc7dc1e836c0964c">dbus_shutdown()</a>, so no thread can be using libdbus.)<p>
The purpose of <a class="el" href="group__DBusMemory.html#g8b177950791eebaefc7dc1e836c0964c">dbus_shutdown()</a> is to allow applications to get clean output from memory leak checkers. <a class="el" href="group__DBusMemory.html#g8b177950791eebaefc7dc1e836c0964c">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>
There is absolutely no requirement to call <a class="el" href="group__DBusMemory.html#g8b177950791eebaefc7dc1e836c0964c">dbus_shutdown()</a> - in fact, most applications won't bother and should not feel guilty.<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#g8b177950791eebaefc7dc1e836c0964c">dbus_shutdown()</a>. One implication of this is that calling <a class="el" href="group__DBusMemory.html#g8b177950791eebaefc7dc1e836c0964c">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>
Definition at line <a class="el" href="dbus-memory_8c-source.html#l00786">786</a> of file <a class="el" href="dbus-memory_8c-source.html">dbus-memory.c</a>.
<p>
References <a class="el" href="dbus-memory_8c-source.html#l00701">ShutdownClosure::data</a>, <a class="el" href="dbus-memory_8c-source.html#l00617">dbus_free()</a>, <a class="el" href="dbus-memory_8c-source.html#l00700">ShutdownClosure::func</a>, <a class="el" href="dbus-memory_8c-source.html#l00699">ShutdownClosure::next</a>, and <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.
</div>
</div><p>
<hr size="1"><address style="align: right;"><small>Generated on Mon Dec 14 22:26:14 2009 for D-Bus by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
</body>
</html>

Anon7 - 2021