CUBRID Engine
latest
|
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "set_object.h"
#include "misc_string.h"
#include "object_domain.h"
#include "dbtype.h"
#include "memory_alloc.h"
#include "util_func.h"
#include "error_manager.h"
#include "intl_support.h"
#include "resource_tracker.hpp"
#include "customheaps.h"
#include "quick_fit.h"
Go to the source code of this file.
Macros | |
#define | DEFAULT_OBSTACK_CHUNK_SIZE 32768 /* 1024 x 32 */ |
Functions | |
int | ansisql_strcmp (const char *s, const char *t) |
int | ansisql_strcasecmp (const char *s, const char *t) |
int | db_alignment (int n) |
int | db_align_to (int n, int alignment) |
HL_HEAPID | db_create_ostk_heap (int chunk_size) |
void | db_destroy_ostk_heap (HL_HEAPID heap_id) |
void * | db_ostk_alloc (HL_HEAPID heap_id, size_t size) |
HL_HEAPID | db_create_private_heap (void) |
void | db_clear_private_heap (THREAD_ENTRY *thread_p, HL_HEAPID heap_id) |
HL_HEAPID | db_change_private_heap (THREAD_ENTRY *thread_p, HL_HEAPID heap_id) |
HL_HEAPID | db_replace_private_heap (THREAD_ENTRY *thread_p) |
void | db_destroy_private_heap (THREAD_ENTRY *thread_p, HL_HEAPID heap_id) |
void * | db_private_alloc_debug (THREAD_ENTRY *thrd, size_t size, bool rc_track, const char *caller_file, int caller_line) |
void * | db_private_realloc_debug (THREAD_ENTRY *thrd, void *ptr, size_t size, bool rc_track, const char *caller_file, int caller_line) |
char * | db_private_strdup (THREAD_ENTRY *thrd, const char *s) |
void | db_private_free_debug (THREAD_ENTRY *thrd, void *ptr, bool rc_track, const char *caller_file, int caller_line) |
void * | db_private_alloc_external (THREAD_ENTRY *thrd, size_t size) |
void | db_private_free_external (THREAD_ENTRY *thrd, void *ptr) |
void * | db_private_realloc_external (THREAD_ENTRY *thrd, void *ptr, size_t size) |
Variables | |
unsigned int | db_on_server |
HL_HEAPID | private_heap_id = 0 |
#define DEFAULT_OBSTACK_CHUNK_SIZE 32768 /* 1024 x 32 */ |
Definition at line 51 of file memory_alloc.c.
Definition at line 134 of file memory_alloc.c.
References intl_identifier_ncasecmp(), and strlen.
Referenced by db_query_get_tuple_value_by_name().
Definition at line 79 of file memory_alloc.c.
Referenced by ehash_compare_key(), and ehash_free_recdes().
int db_align_to | ( | int | n, |
int | alignment | ||
) |
Definition at line 224 of file memory_alloc.c.
Referenced by compute_rec_size().
int db_alignment | ( | int | n | ) |
Definition at line 192 of file memory_alloc.c.
Referenced by compute_rec_size().
HL_HEAPID db_change_private_heap | ( | THREAD_ENTRY * | thread_p, |
HL_HEAPID | heap_id | ||
) |
Definition at line 337 of file memory_alloc.c.
References db_on_server, and private_heap_id.
Referenced by btree_insert_list::add_key(), copy_bind_value_to_tdes(), fpcache_claim(), fpcache_entry_uninit(), fpcache_finalize(), fpcache_initialize(), fpcache_retire(), locator_eval_filter_predicate(), logtb_clear_tdes(), partition_free_cache_entry(), partition_pruning_context_to_cache_entry(), qdata_calculate_aggregate_cume_dist_percent_rank(), qdata_get_dbval_from_constant_regu_variable(), qexec_execute_build_columns(), qexec_execute_build_indexes(), qexec_resolve_domains_for_aggregation(), qfile_free_list_cache_entry(), qfile_update_list_cache_entry(), cubmem::switch_to_global_allocator_and_call(), xcache_clone_decache(), xcache_finalize(), xcache_find_xasl_id_for_execute(), xcache_initialize(), and btree_insert_list::~btree_insert_list().
void db_clear_private_heap | ( | THREAD_ENTRY * | thread_p, |
HL_HEAPID | heap_id | ||
) |
Definition at line 314 of file memory_alloc.c.
References hl_clear_lea_heap(), and private_heap_id.
Referenced by net_server_request().
HL_HEAPID db_create_ostk_heap | ( | int | chunk_size | ) |
Definition at line 239 of file memory_alloc.c.
References hl_register_ostk_heap().
Referenced by pt_alloc_packing_buf().
HL_HEAPID db_create_private_heap | ( | void | ) |
Definition at line 294 of file memory_alloc.c.
References db_on_server, and hl_register_lea_heap().
Referenced by db_replace_private_heap(), and cubthread::entry::entry().
void db_destroy_ostk_heap | ( | HL_HEAPID | heap_id | ) |
Definition at line 250 of file memory_alloc.c.
References hl_unregister_ostk_heap().
Referenced by pt_free_packing_buf().
void db_destroy_private_heap | ( | THREAD_ENTRY * | thread_p, |
HL_HEAPID | heap_id | ||
) |
Definition at line 388 of file memory_alloc.c.
References db_private_alloc_debug(), hl_unregister_lea_heap(), NULL, and private_heap_id.
Referenced by cubthread::entry::clear_resources().
void* db_ostk_alloc | ( | HL_HEAPID | heap_id, |
size_t | size | ||
) |
Definition at line 262 of file memory_alloc.c.
References hl_ostk_alloc(), hl_ostk_free(), and NULL.
Referenced by pt_alloc_packing_buf().
void* db_private_alloc_debug | ( | THREAD_ENTRY * | thrd, |
size_t | size, | ||
bool | rc_track, | ||
const char * | caller_file, | ||
int | caller_line | ||
) |
Definition at line 433 of file memory_alloc.c.
References ARG_FILE_LINE, assert, db_on_server, db_private_realloc_debug(), db_ws_alloc(), ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), cubthread::entry::get_alloc_tracker(), hl_lea_alloc(), cubbase::resource_tracker< Res >::increment(), NULL, private_heap_id, and thread_get_thread_entry_info().
Referenced by db_destroy_private_heap(), and db_private_alloc_external().
void* db_private_alloc_external | ( | THREAD_ENTRY * | thrd, |
size_t | size | ||
) |
Definition at line 804 of file memory_alloc.c.
References db_private_alloc_debug().
void db_private_free_debug | ( | THREAD_ENTRY * | thrd, |
void * | ptr, | ||
bool | rc_track, | ||
const char * | caller_file, | ||
int | caller_line | ||
) |
Definition at line 724 of file memory_alloc.c.
References db_on_server, db_ws_free(), hl_lea_free(), NULL, and private_heap_id.
Referenced by db_private_free_external(), and db_private_strdup().
void db_private_free_external | ( | THREAD_ENTRY * | thrd, |
void * | ptr | ||
) |
Definition at line 815 of file memory_alloc.c.
References db_private_free_debug().
void* db_private_realloc_debug | ( | THREAD_ENTRY * | thrd, |
void * | ptr, | ||
size_t | size, | ||
bool | rc_track, | ||
const char * | caller_file, | ||
int | caller_line | ||
) |
Definition at line 555 of file memory_alloc.c.
References ARG_FILE_LINE, db_on_server, db_private_alloc, db_ws_realloc(), cubbase::resource_tracker< Res >::decrement(), ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), cubthread::entry::get_alloc_tracker(), hl_lea_realloc(), cubbase::resource_tracker< Res >::increment(), NULL, private_heap_id, and thread_get_thread_entry_info().
Referenced by db_private_alloc_debug(), and db_private_realloc_external().
void* db_private_realloc_external | ( | THREAD_ENTRY * | thrd, |
void * | ptr, | ||
size_t | size | ||
) |
Definition at line 826 of file memory_alloc.c.
References ARG_FILE_LINE, assert, db_private_realloc_debug(), cubbase::resource_tracker< Res >::decrement(), ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), cubthread::entry::get_alloc_tracker(), cubbase::resource_tracker< Res >::increment(), NULL, REFPTR, and thread_get_thread_entry_info().
char* db_private_strdup | ( | THREAD_ENTRY * | thrd, |
const char * | s | ||
) |
Definition at line 675 of file memory_alloc.c.
References db_private_alloc, db_private_free_debug(), NULL, and strlen.
Referenced by btree_index_start_scan(), caslob_to_dblob(), db_get_deep_copy_of_json(), db_json_bool_to_string(), db_json_copy_string_from_value(), db_json_get_raw_json_body_from_document(), db_json_pretty_func(), db_json_unquote(), elo_copy(), elo_copy_structure(), elo_create(), mr_setval_json(), net_arg_get_lob_value(), or_get_json_schema(), and pt_data_type_init_value().
HL_HEAPID db_replace_private_heap | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 359 of file memory_alloc.c.
References db_create_private_heap(), db_on_server, and private_heap_id.
unsigned int db_on_server |
Definition at line 91 of file network_interface_cl.c.
Referenced by db_change_private_heap(), db_create_private_heap(), db_private_alloc_debug(), db_private_free_debug(), db_private_realloc_debug(), db_replace_private_heap(), and fileio_request_user_response().
HL_HEAPID private_heap_id = 0 |
Definition at line 55 of file memory_alloc.c.
Referenced by db_change_private_heap(), db_clear_private_heap(), db_destroy_private_heap(), db_private_alloc_debug(), db_private_free_debug(), db_private_realloc_debug(), db_replace_private_heap(), and showstmt_array_end_scan().