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_t * | al_halloc (void *context) |
| Allocate a array_list_t that will be automatically disposed of when the specified context is free'd. | |
| string_buffer_t * | sb_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. | |
| 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().
| void* global_context |
This pointer is a valid halloc context that will be freed right before program shutdown.
It may be used to allocate memory that should be freed when the program shuts down.
Referenced by builtin_help_get(), complete_get_desc_suffix(), complete_init(), error(), event_get_desc(), exec_pipe(), expand_variables(), halloc_util_destroy(), halloc_util_init(), history_escape_newlines(), history_unescape_newlines(), input_terminfo_get_name(), input_terminfo_get_sequence(), item_get(), output_set_term(), parse_util_load(), parse_util_load_internal(), proc_init(), wbasename(), wdirname(), wgetenv(), wgettext_init(), wildcard_completion_allocate(), writestr(), and wsetlocale().
1.5.6