|
YAZ 5.37.0
|
Header for memory handling functions. More...
Go to the source code of this file.
Macros | |
| #define | xrealloc(o, x) |
| utility macro which calls xrealloc_f | |
| #define | xmalloc(x) |
| utility macro which calls malloc_f | |
| #define | xcalloc(x, y) |
| utility macro which calls xcalloc_f | |
| #define | xfree(x) |
| utility macro which calls xfree_f | |
| #define | xstrdup(s) |
| utility macro which calls xstrdup_f | |
| #define | xstrndup(s, n) |
| utility macro which calls xstrndup_f | |
| #define | xmalloc_trav(s) |
| utility macro which calls malloc_trav_f | |
Functions | |
| void * | xrealloc_f (void *o, size_t size, const char *file, int line) |
| realloc | |
| void * | xmalloc_f (size_t size, const char *file, int line) |
| malloc | |
| void * | xcalloc_f (size_t nmemb, size_t size, const char *file, int line) |
| calloc | |
| char * | xstrdup_f (const char *p, const char *file, int line) |
| strdup | |
| char * | xstrndup_f (const char *p, size_t n, const char *file, int line) |
| strndup | |
| void | xfree_f (void *p, const char *file, int line) |
| free | |
| void | xmalloc_trav_f (const char *s, const char *file, int line) |
| logs all xmalloc buffers | |
Header for memory handling functions.
This is a set of wrapper functions for the memory allocation routines from stdlib.h.. Such as malloc, free, realloc etc. These functions calls exit if memory allocation fails.
Definition in file xmalloc.h.
| #define xcalloc | ( | x, | |
| y ) |
utility macro which calls xcalloc_f
| #define xfree | ( | x | ) |
utility macro which calls xfree_f
Definition at line 53 of file xmalloc.h.
Referenced by assoc_init_reset(), bend_close(), ccl_parser_destroy(), ccl_qual_add_special_ar(), ccl_qual_field2(), ccl_qual_rm(), ccl_rpn_delete(), ccl_set_attr_numeric(), ccl_stop_words_destroy(), ccl_token_del(), control_association(), cql_parser_destroy(), cql_transform_close(), cql_transform_define_FILE(), cs_create_host2(), cs_parse_host(), destroy_ar(), destroy_association(), destroy_danmarc(), destroy_danmarc(), destroy_iso5426(), destroy_iso_8859_1(), destroy_marc8(), destroy_marc8(), free_block(), get_cert(), handle_http(), iochan_event_loop(), json_parser_destroy(), json_remove_node(), my_close(), nmem_destroy(), odr_destroy(), qualifier_list(), rdf_lookup_node(), remove_sets(), request_delq(), response_default_diag(), resultset_destroy(), search_term_split_list(), send_HTTP_redirect(), tcpip_accept(), tcpip_close(), tcpip_rcvconnect(), tcpip_straddr(), unix_accept(), unix_close(), unix_straddr(), wrbuf_destroy(), yaz_cookies_destroy(), yaz_cookies_reset(), yaz_cookies_response(), yaz_iconv_close(), yaz_marc_destroy(), yaz_marc_leader_spec(), yaz_marc_sax_destroy(), yaz_mime_types_destroy(), yaz_oid_db_destroy(), yaz_pqf_destroy(), yaz_record_conv_destroy(), yaz_record_conv_set_path(), yaz_retrieval_destroy(), yaz_retrieval_set_path(), yaz_sc_destroy(), yaz_spipe_create(), yaz_spipe_destroy(), yaz_thread_create(), yaz_thread_detach(), yaz_thread_join(), yaz_timing_destroy(), yaz_tok_cfg_destroy(), yaz_tok_cfg_single_tokens(), yaz_tok_parse_destroy(), yaz_url_destroy(), yaz_url_exec(), yaz_url_set_proxy(), yaz_xml_get_prop(), ZOOM_connection_connect(), ZOOM_connection_destroy(), ZOOM_connection_remove_task(), ZOOM_Event_destroy(), ZOOM_event_sys_yaz_poll(), ZOOM_handle_Z3950_apdu(), ZOOM_options_destroy(), ZOOM_options_setl(), ZOOM_package_send(), ZOOM_query_cql(), ZOOM_query_cql2rpn(), ZOOM_query_prefix(), ZOOM_record_destroy(), ZOOM_set_dset_error(), and ztest_search().
| #define xmalloc | ( | x | ) |
utility macro which calls malloc_f
Definition at line 49 of file xmalloc.h.
Referenced by add_attr_node(), append_entry(), assoc_init_reset(), bend_init(), ccl_parser_create(), ccl_parser_tokenize(), ccl_qual_add_combi(), ccl_qual_add_set(), ccl_qual_add_special(), ccl_qual_add_special_ar(), ccl_qual_dup(), ccl_qual_mk(), ccl_qual_new(), ccl_rpn_node_create(), ccl_stop_words_create(), ccl_term_one_use(), ccl_token_add(), connect_and_bind(), copy_token_name(), cql_parser_create(), cql_transform_create(), cql_transform_parse_tok_line(), create_ar(), create_association(), cs_parse_host(), get_block(), iochan_create(), iochan_event_loop(), json_new_node(), json_parse_string(), json_parser_create(), json_parser_subst(), my_init(), nmem_create(), odr_createmem(), odr_grow_block(), qualifier_list(), rdf_lookup_node(), request_get(), search_term_split_list(), search_terms(), set_value(), tcpip_accept(), tcpip_get(), tcpip_state_create(), tcpip_type(), unix_accept(), unix_get(), unix_type(), wrbuf_alloc(), yaz_cookies_create(), yaz_cookies_response(), yaz_danmarc_decoder(), yaz_danmarc_encoder(), yaz_iconv_open(), yaz_iso5426_decoder(), yaz_iso_8859_1_encoder(), yaz_marc8_decoder(), yaz_marc8_encoder(), yaz_marc_create(), yaz_marc_sax_new(), yaz_mime_types_add(), yaz_mime_types_create(), yaz_oid_add(), yaz_oid_db_new(), yaz_pqf_create(), yaz_record_conv_create(), yaz_retrieval_create(), yaz_sc_create(), yaz_spipe_create(), yaz_thread_create(), yaz_timing_create(), yaz_tok_cfg_create(), yaz_tok_parse_create(), yaz_url_create(), yaz_xml_get_prop(), ZOOM_connection_add_task(), ZOOM_connection_connect(), ZOOM_connection_create(), ZOOM_connection_insert_task(), ZOOM_connection_package(), ZOOM_connection_scan1(), ZOOM_Event_create(), ZOOM_event_sys_yaz_poll(), ZOOM_options_create_with_parent2(), ZOOM_package_send(), ZOOM_query_create(), ZOOM_record_clone(), ZOOM_resultset_create(), ZOOM_set_dset_error(), and ztest_search().
| #define xmalloc_trav | ( | s | ) |
utility macro which calls malloc_trav_f
Definition at line 59 of file xmalloc.h.
Referenced by destroy_association().
| #define xrealloc | ( | o, | |
| x ) |
utility macro which calls xrealloc_f
Definition at line 47 of file xmalloc.h.
Referenced by ccl_qual_add_special(), odr_grow_block(), tcpip_get(), unix_get(), and wrbuf_grow().
| #define xstrdup | ( | s | ) |
utility macro which calls xstrdup_f
Definition at line 55 of file xmalloc.h.
Referenced by add_attr_node(), append_entry(), ccl_add_attr_string(), ccl_qual_add_combi(), ccl_qual_add_special(), ccl_qual_add_special_ar(), ccl_qual_dup(), ccl_qual_field2(), ccl_qual_new(), ccl_set_attr_numeric(), ccl_stop_words_create(), ccl_term_one_use(), cql2pqf(), cql_transform_define_FILE(), cql_transform_parse_tok_line(), create_ar(), cs_create_host2(), cs_get_peer_certificate_x509(), handle_http(), tcpip_straddr(), unix_straddr(), yaz_marc_leader_spec(), yaz_mime_types_add(), yaz_oid_add(), yaz_record_conv_set_path(), yaz_retrieval_set_path(), yaz_sc_create(), yaz_tok_cfg_create(), yaz_tok_cfg_single_tokens(), yaz_url_set_proxy(), ZOOM_connection_connect(), ZOOM_connection_search(), ZOOM_handle_Z3950_apdu(), ZOOM_query_cql(), ZOOM_query_prefix(), ZOOM_resultset_retrieve(), ZOOM_set_dset_error(), and ztest_search().
| #define xstrndup | ( | s, | |
| n ) |
utility macro which calls xstrndup_f
Definition at line 57 of file xmalloc.h.
Referenced by yaz_cookies_response().
| void * xcalloc_f | ( | size_t | nmemb, |
| size_t | size, | ||
| const char * | file, | ||
| int | line ) |
calloc
| nmemb | number of members |
| size | size of member |
| file | fname location of use |
| line | line location of use |
This function is invoked via macro xcalloc in which file and line are set automatically.
Definition at line 302 of file xmalloc.c.
References log_level, log_level_initialized, xcalloc_d, xmalloc_fatal(), yaz_log(), yaz_log_module_level(), and YLOG_FATAL.
| void xfree_f | ( | void * | p, |
| const char * | file, | ||
| int | line ) |
| void * xmalloc_f | ( | size_t | size, |
| const char * | file, | ||
| int | line ) |
malloc
| size | size of buffer to be allocated |
| file | fname location of use |
| line | line location of use |
This function is invoked via macro xmalloc in which file and line are set automatically.
Definition at line 279 of file xmalloc.c.
References log_level, log_level_initialized, xmalloc_d, xmalloc_fatal(), yaz_log(), yaz_log_module_level(), and YLOG_FATAL.
Referenced by xstrndup_f().
| void xmalloc_trav_f | ( | const char * | s, |
| const char * | file, | ||
| int | line ) |
logs all xmalloc buffers
| s | not used |
| file | fname location of use |
| line | line location of use |
This function is invoked via macro xmalloc_trav in which file and line are set automatically. Only if TRACE_XMALLOC > 1 this function does any real work!
Definition at line 240 of file xmalloc.c.
References log_level, log_level_initialized, xmalloc_trav_d, and yaz_log_module_level().
| void * xrealloc_f | ( | void * | o, |
| size_t | size, | ||
| const char * | file, | ||
| int | line ) |
realloc
| o | buffer to be reallocated |
| size | size of buffer to be allocated |
| file | fname location of use |
| line | line location of use |
This function is invoked via macro xrealloc in which file and line are set automatically.
Definition at line 257 of file xmalloc.c.
References log_level, log_level_initialized, xmalloc_fatal(), xrealloc_d, yaz_log(), yaz_log_module_level(), and YLOG_FATAL.
| char * xstrdup_f | ( | const char * | p, |
| const char * | file, | ||
| int | line ) |
strdup
| p | string to be cloned |
| file | fname location of use |
| line | line location of use |
This function is invoked via macro xstrdup in which file and line are set automatically.
Definition at line 324 of file xmalloc.c.
References log_level, log_level_initialized, xmalloc_d, yaz_log(), and yaz_log_module_level().
Referenced by xstrndup_f().
| char * xstrndup_f | ( | const char * | p, |
| size_t | n, | ||
| const char * | file, | ||
| int | line ) |
strndup
| p | string to be cloned |
| n | max size of resulting string (excluding 0) |
| file | fname location of use |
| line | line location of use |
This function is invoked via macro xstrndup in which file and line are set automatically.
Definition at line 350 of file xmalloc.c.
References xmalloc_f(), and xstrdup_f().