index.html
Main Page
|
modules.html
Modules
|
namespaces.html
Namespace List
|
hierarchy.html
Class Hierarchy
|
annotated.html
Data Structures
|
dirs.html
Directories
|
files.html
File List
|
namespacemembers.html
Namespace Members
|
functions.html
Data Fields
|
pages.html
Related Pages
Memory Allocation
[
group__DBus.html
D-BUS low-level public API
]
group__DBusMemory.html#ga0
dbus_malloc()
,
group__DBusMemory.html#ga3
dbus_free()
, etc.
#_details
More...
Defines
#define
group__DBusMemory.html#ga6
dbus_new
(type, count)   ((type*)dbus_malloc (sizeof (type) * (count)));
Safe macro for using
group__DBusMemory.html#ga0
dbus_malloc()
.
#ga6
#define
group__DBusMemory.html#ga7
dbus_new0
(type, count)   ((type*)dbus_malloc0 (sizeof (type) * (count)));
Safe macro for using
group__DBusMemory.html#ga1
dbus_malloc0()
.
#ga7
Typedefs
typedef void(*
group__DBusMemory.html#ga8
DBusFreeFunction
)(void *memory)
The type of a function which frees a block of memory.
#ga8
Functions
void *
group__DBusMemory.html#ga0
dbus_malloc
(size_t bytes)
Allocates the given number of bytes, as with standard malloc().
#ga0
void *
group__DBusMemory.html#ga1
dbus_malloc0
(size_t bytes)
Allocates the given number of bytes, as with standard malloc(), but all bytes are initialized to zero as with calloc().
#ga1
void *
group__DBusMemory.html#ga2
dbus_realloc
(void *memory, size_t bytes)
Resizes a block of memory previously allocated by
group__DBusMemory.html#ga0
dbus_malloc()
or
group__DBusMemory.html#ga1
dbus_malloc0()
.
#ga2
void
group__DBusMemory.html#ga3
dbus_free
(void *memory)
Frees a block of memory previously allocated by
group__DBusMemory.html#ga0
dbus_malloc()
or
group__DBusMemory.html#ga1
dbus_malloc0()
.
#ga3
void
group__DBusMemory.html#ga4
dbus_free_string_array
(char **str_array)
Frees a
group__DBusMacros.html#ga4
NULL
-terminated array of strings.
#ga4
void
group__DBusMemory.html#ga5
dbus_shutdown
(void)
The D-BUS library keeps some internal global variables, for example to cache the username of the current process.
#ga5
Detailed Description
group__DBusMemory.html#ga0
dbus_malloc()
,
group__DBusMemory.html#ga3
dbus_free()
, etc.
Functions and macros related to allocating and releasing blocks of memory.
Define Documentation
#define dbus_new
(
type,
count
)
((type*)dbus_malloc (sizeof (type) * (count)));
Safe macro for using
group__DBusMemory.html#ga0
dbus_malloc()
.
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*.
Parameters:
type
type name to allocate
count
number of instances in the allocated array
Returns:
the new memory block or
group__DBusMacros.html#ga4
NULL
on failure
Definition at line
dbus-memory_8h-source.html#l00041
41
of file
dbus-memory_8h-source.html
dbus-memory.h
.
Referenced by
dbus-resources_8c-source.html#l00077
_dbus_counter_new()
,
dbus-memory_8c-source.html#l00711
_dbus_register_shutdown_func()
,
dbus-userdb-util_8c-source.html#l00335
_dbus_user_database_get_groups()
, and
dbus-address_8c-source.html#l00320
dbus_parse_address()
.
#define dbus_new0
(
type,
count
)
((type*)dbus_malloc0 (sizeof (type) * (count)));
Safe macro for using
group__DBusMemory.html#ga1
dbus_malloc0()
.
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.
Parameters:
type
type name to allocate
count
number of instances in the allocated array
Returns:
the new memory block or
group__DBusMacros.html#ga4
NULL
on failure
Definition at line
dbus-memory_8h-source.html#l00042
42
of file
dbus-memory_8h-source.html
dbus-memory.h
.
Referenced by
dbus-connection_8c-source.html#l01070
_dbus_connection_new_for_transport()
,
dbus-object-tree_8c-source.html#l01081
_dbus_decompose_path()
,
dbus-sysdeps-util_8c-source.html#l00456
_dbus_directory_open()
,
dbus-internals_8c-source.html#l00354
_dbus_dup_string_array()
,
dbus-hash_8c-source.html#l00292
_dbus_hash_table_new()
,
dbus-mempool_8c-source.html#l00136
_dbus_mem_pool_new()
,
dbus-message_8c-source.html#l01760
_dbus_message_iter_get_args_valist()
,
dbus-message_8c-source.html#l03123
_dbus_message_loader_new()
,
dbus-object-tree_8c-source.html#l00090
_dbus_object_tree_new()
,
dbus-pending-call_8c-source.html#l00052
_dbus_pending_call_new()
,
dbus-server-unix_8c-source.html#l00254
_dbus_server_new_for_fd()
,
dbus-timeout_8c-source.html#l00193
_dbus_timeout_list_new()
,
dbus-timeout_8c-source.html#l00062
_dbus_timeout_new()
,
dbus-transport-unix_8c-source.html#l01122
_dbus_transport_new_for_fd()
,
dbus-userdb_8c-source.html#l00102
_dbus_user_database_lookup()
,
dbus-userdb-util_8c-source.html#l00189
_dbus_user_database_lookup_group()
,
dbus-userdb_8c-source.html#l00440
_dbus_user_database_new()
,
dbus-watch_8c-source.html#l00208
_dbus_watch_list_new()
,
dbus-watch_8c-source.html#l00067
_dbus_watch_new()
,
dbus-connection_8c-source.html#l04146
dbus_connection_add_filter()
,
dbus-message_8c-source.html#l01022
dbus_message_copy()
, and
dbus-address_8c-source.html#l00320
dbus_parse_address()
.
Typedef Documentation
group__DBusMemory.html#ga8
DBusFreeFunction
The type of a function which frees a block of memory.
Parameters:
memory
the memory to free
Definition at line
dbus-memory_8h-source.html#l00046
46
of file
dbus-memory_8h-source.html
dbus-memory.h
.
Function Documentation
void dbus_free
(
void *
memory
)
Frees a block of memory previously allocated by
group__DBusMemory.html#ga0
dbus_malloc()
or
group__DBusMemory.html#ga1
dbus_malloc0()
.
If passed
group__DBusMacros.html#ga4
NULL
, does nothing.
Parameters:
memory
block to be freed
Definition at line
dbus-memory_8c-source.html#l00612
612
of file
dbus-memory_8c-source.html
dbus-memory.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
, and
group__DBusMacros.html#ga2
TRUE
.
Referenced by
dbus-auth_8c-source.html#l02074
_dbus_auth_unref()
,
dbus-spawn_8c-source.html#l00262
_dbus_babysitter_unref()
,
dbus-connection_8c-source.html#l01070
_dbus_connection_new_for_transport()
,
dbus-resources_8c-source.html#l00118
_dbus_counter_unref()
,
dbus-dataslot_8c-source.html#l00161
_dbus_data_slot_allocator_free()
,
dbus-dataslot_8c-source.html#l00348
_dbus_data_slot_list_free()
,
dbus-sysdeps-util_8c-source.html#l00545
_dbus_directory_close()
,
dbus-sysdeps-util_8c-source.html#l00689
_dbus_group_info_free()
,
dbus-userdb_8c-source.html#l00059
_dbus_group_info_free_allocated()
,
dbus-hash_8c-source.html#l00292
_dbus_hash_table_new()
,
dbus-hash_8c-source.html#l00374
_dbus_hash_table_unref()
,
dbus-keyring_8c-source.html#l00689
_dbus_keyring_unref()
,
dbus-mempool_8c-source.html#l00336
_dbus_mem_pool_dealloc()
,
dbus-mempool_8c-source.html#l00183
_dbus_mem_pool_free()
,
dbus-message_8c-source.html#l03123
_dbus_message_loader_new()
,
dbus-message_8c-source.html#l03173
_dbus_message_loader_unref()
,
dbus-object-tree_8c-source.html#l00090
_dbus_object_tree_new()
,
dbus-object-tree_8c-source.html#l00141
_dbus_object_tree_unref()
,
dbus-pending-call_8c-source.html#l00052
_dbus_pending_call_new()
,
dbus-server_8c-source.html#l00195
_dbus_server_finalize_base()
,
dbus-server_8c-source.html#l00114
_dbus_server_init_base()
,
dbus-server-unix_8c-source.html#l00315
_dbus_server_new_for_domain_socket()
,
dbus-server-unix_8c-source.html#l00254
_dbus_server_new_for_fd()
,
dbus-string_8c-source.html#l00261
_dbus_string_free()
,
dbus-timeout_8c-source.html#l00210
_dbus_timeout_list_free()
,
dbus-timeout_8c-source.html#l00106
_dbus_timeout_unref()
,
dbus-transport_8c-source.html#l00186
_dbus_transport_finalize_base()
,
dbus-transport-unix_8c-source.html#l01122
_dbus_transport_new_for_fd()
,
dbus-transport_8c-source.html#l00212
_dbus_transport_open()
,
dbus-userdb_8c-source.html#l00501
_dbus_user_database_unref()
,
dbus-sysdeps_8c-source.html#l01686
_dbus_user_info_free()
,
dbus-userdb_8c-source.html#l00043
_dbus_user_info_free_allocated()
,
dbus-watch_8c-source.html#l00225
_dbus_watch_list_free()
,
dbus-watch_8c-source.html#l00117
_dbus_watch_unref()
,
dbus-address_8c-source.html#l00097
dbus_address_entries_free()
,
dbus-connection_8c-source.html#l02128
dbus_connection_free_preallocated_send()
,
dbus-errors_8c-source.html#l00174
dbus_error_free()
,
dbus-memory_8c-source.html#l00650
dbus_free_string_array()
,
dbus-message_8c-source.html#l01022
dbus_message_copy()
,
dbus-address_8c-source.html#l00320
dbus_parse_address()
,
dbus-pending-call_8c-source.html#l00170
dbus_pending_call_unref()
,
dbus-memory_8c-source.html#l00539
dbus_realloc()
,
dbus-memory_8c-source.html#l00756
dbus_shutdown()
, and
message_8cpp-source.html#l00226
DBusQt::Message::iterator::fillVar()
.
void dbus_free_string_array
(
char **
str_array
)
Frees a
group__DBusMacros.html#ga4
NULL
-terminated array of strings.
If passed
group__DBusMacros.html#ga4
NULL
, does nothing.
Parameters:
str_array
the array to be freed
Definition at line
dbus-memory_8c-source.html#l00650
650
of file
dbus-memory_8c-source.html
dbus-memory.c
.
References
dbus-memory_8c-source.html#l00612
dbus_free()
.
Referenced by
dbus-auth_8c-source.html#l02120
_dbus_auth_set_mechanisms()
,
dbus-auth_8c-source.html#l02074
_dbus_auth_unref()
,
dbus-object-tree_8c-source.html#l01081
_dbus_decompose_path()
,
dbus-internals_8c-source.html#l00354
_dbus_dup_string_array()
,
dbus-message_8c-source.html#l01760
_dbus_message_iter_get_args_valist()
,
dbus-object-tree_8c-source.html#l00749
_dbus_object_tree_dispatch_and_unlock()
,
dbus-server_8c-source.html#l00195
_dbus_server_finalize_base()
,
dbus-connection_8c-source.html#l04377
dbus_connection_get_object_path_data()
,
dbus-connection_8c-source.html#l04414
dbus_connection_list_registered()
,
dbus-connection_8c-source.html#l04305
dbus_connection_register_fallback()
,
dbus-connection_8c-source.html#l04262
dbus_connection_register_object_path()
,
dbus-connection_8c-source.html#l04345
dbus_connection_unregister_object_path()
, and
dbus-server_8c-source.html#l01015
dbus_server_set_auth_mechanisms()
.
void* dbus_malloc
(
size_t
bytes
)
Allocates the given number of bytes, as with standard malloc().
Guaranteed to return
group__DBusMacros.html#ga4
NULL
if bytes is zero on all platforms. Returns
group__DBusMacros.html#ga4
NULL
if the allocation fails. The memory must be released with
group__DBusMemory.html#ga3
dbus_free()
.
Parameters:
bytes
number of bytes to allocate
Returns:
allocated memory, or
group__DBusMacros.html#ga4
NULL
if the allocation fails.
Definition at line
dbus-memory_8c-source.html#l00437
437
of file
dbus-memory_8c-source.html
dbus-memory.c
.
References
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-mempool_8c-source.html#l00208
_dbus_mem_pool_alloc()
,
dbus-internals_8c-source.html#l00331
_dbus_memdup()
,
dbus-internals_8c-source.html#l00303
_dbus_strdup()
,
dbus-string_8c-source.html#l00696
_dbus_string_copy_data()
, and
dbus-string_8c-source.html#l00130
_dbus_string_init_preallocated()
.
void* dbus_malloc0
(
size_t
bytes
)
Allocates the given number of bytes, as with standard malloc(), but all bytes are initialized to zero as with calloc().
Guaranteed to return
group__DBusMacros.html#ga4
NULL
if bytes is zero on all platforms. Returns
group__DBusMacros.html#ga4
NULL
if the allocation fails. The memory must be released with
group__DBusMemory.html#ga3
dbus_free()
.
Parameters:
bytes
number of bytes to allocate
Returns:
allocated memory, or
group__DBusMacros.html#ga4
NULL
if the allocation fails.
Definition at line
dbus-memory_8c-source.html#l00488
488
of file
dbus-memory_8c-source.html
dbus-memory.c
.
References
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-mempool_8c-source.html#l00208
_dbus_mem_pool_alloc()
.
void* dbus_realloc
(
void *
memory
,
size_t
bytes
)
Resizes a block of memory previously allocated by
group__DBusMemory.html#ga0
dbus_malloc()
or
group__DBusMemory.html#ga1
dbus_malloc0()
.
Guaranteed to free the memory and return
group__DBusMacros.html#ga4
NULL
if bytes is zero on all platforms. Returns
group__DBusMacros.html#ga4
NULL
if the resize fails. If the resize fails, the memory is not freed.
Parameters:
memory
block to be resized
bytes
new size of the memory block
Returns:
allocated memory, or
group__DBusMacros.html#ga4
NULL
if the resize fails.
Definition at line
dbus-memory_8c-source.html#l00539
539
of file
dbus-memory_8c-source.html
dbus-memory.c
.
References
dbus-memory_8c-source.html#l00612
dbus_free()
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-dataslot_8c-source.html#l00067
_dbus_data_slot_allocator_alloc()
, and
dbus-dataslot_8c-source.html#l00233
_dbus_data_slot_list_set()
.
void dbus_shutdown
(
void
)
The D-BUS library keeps some internal global variables, for example to cache the username of the current process.
This function is used to free these global variables. It is really useful only for leak-checking cleanliness and the like. WARNING: this function is NOT thread safe, it must be called while NO other threads are using D-BUS. You cannot continue using D-BUS after calling this function, as it does things like free global mutexes created by
group__DBusThreads.html#ga0
dbus_threads_init()
. To use a D-BUS function after calling
group__DBusMemory.html#ga5
dbus_shutdown()
, you have to start over from scratch, e.g. calling
group__DBusThreads.html#ga0
dbus_threads_init()
again.
Definition at line
dbus-memory_8c-source.html#l00756
756
of file
dbus-memory_8c-source.html
dbus-memory.c
.
References
dbus-memory_8c-source.html#l00696
ShutdownClosure::data
,
dbus-memory_8c-source.html#l00612
dbus_free()
,
dbus-memory_8c-source.html#l00695
ShutdownClosure::func
,
dbus-memory_8c-source.html#l00694
ShutdownClosure::next
, and
group__DBusMacros.html#ga4
NULL
.
Generated on Tue Sep 13 01:28:09 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
