halloc_util.h File Reference

Various halloc-related utility functions. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void halloc_util_init ()
 Create the global_context halloc object.
void halloc_util_destroy ()
 Free the global_context halloc object.
array_list_tal_halloc (void *context)
 Allocate a array_list_t that will be automatically disposed of when the specified context is free'd.
string_buffer_tsb_halloc (void *context)
 Allocate a string_buffer_t that will be automatically disposed of when the specified context is free'd.
void halloc_register_function_void (void *context, void(*func)())
 Register the specified function to run when the specified context is free'd.
void * halloc_register (void *context, void *data)
 Free the memory pointed to by data when the memory pointed to by context is free:d.
wchar_t * halloc_wcsdup (void *context, const wchar_t *str)
 Make a copy of the specified string using memory allocated using halloc and the specified context.
wchar_t * halloc_wcsndup (void *context, const wchar_t *in, int c)
 Make a copy of the specified substring using memory allocated using halloc and the specified context.

Variables

void * global_context
 This pointer is a valid halloc context that will be freed right before program shutdown.


Detailed Description

Various halloc-related utility functions.


Function Documentation

void* halloc_register ( void *  context,
void *  data 
)

Free the memory pointed to by data when the memory pointed to by context is free:d.

Note that this will _not_ turn the specified memory area into a valid halloc context. Only memory areas created using a call to halloc( 0, size ) can be used as a context.

References halloc_register_function().

Referenced by builtin_block(), builtin_for(), exec(), expand_one(), expand_string(), is_potential_path(), parse_job(), parse_job_argument_list(), and path_get_cdpath().

void halloc_register_function_void ( void *  context,
void(*)()  func 
)

Register the specified function to run when the specified context is free'd.

This function is related to halloc_register_function, but the specified function dowes not take an argument.

References halloc_passthrough(), and halloc_register_function().

Referenced by complete_get_desc_suffix(), complete_init(), parse_util_load(), parser_push_block(), wgettext_init(), and writestr().


Variable Documentation


Generated on Sun Mar 8 15:46:55 2009 for fish by  doxygen 1.5.6