mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 12:01:42 +01:00
a1bcf38257
Disable log archiving code unless #ifdef UNIV_LOG_ARCHIVE Remove (char*) casts of string constants; add const qualifiers Remove some Hot Backup code unless #ifdef UNIV_HOTBACKUP innobase/btr/btr0cur.c: Cast away constness from dfield_get_data() result innobase/buf/buf0buf.c: Enclose a debug assertion in #ifdef UNIV_SYNC_DEBUG innobase/buf/buf0rea.c: Corrected compile error #ifdef UNIV_DEBUG innobase/dict/dict0boot.c: Remove (char*) casts of string constants innobase/dict/dict0crea.c: Remove (char*) casts of string constants innobase/dict/dict0dict.c: Enclosed a debug assertion in #ifdef UNIV_SYNC_DEBUG Replaced some debug assertions with preprocessor tests Add const qualifiers to string constants innobase/dict/dict0load.c: Remove (char*) casts of string constants innobase/fil/fil0fil.c: Remove (char*) casts of string constants Enclose debug assertions in #ifdef UNIV_SYNC_DEBUG innobase/ha/ha0ha.c: Enclose debug assertion in #ifdef UNIV_SYNC_DEBUG innobase/ibuf/ibuf0ibuf.c: Remove (char*) casts of string constants innobase/include/buf0buf.ic: Add const qualifier to string parameter innobase/include/fil0fil.h: Disable log archiving code unless #ifdef UNIV_LOG_ARCHIVE innobase/include/log0recv.h: Disable log archiving code unless #ifdef UNIV_LOG_ARCHIVE Enclose ibbackup specific code in #ifdef UNIV_HOTBACKUP innobase/include/mem0dbg.ic: Add const qualifiers to string parameters innobase/include/srv0srv.h: Add const qualifiers to string constants Enclose srv_arch_dir and srv_log_archive_on #ifdef UNIV_LOG_ARCHIVE innobase/include/sync0rw.ic: Add const qualifier to string parameter innobase/include/sync0sync.ic: Add const qualifier to string parameter innobase/log/log0log.c: Enclose log archiving code in #ifdef UNIV_LOG_ARCHIVE Do not cast string constants to (char*) innobase/log/log0recv.c: Enclose ibbackup specific code in #ifdef UNIV_HOTBACKUP Enclose disabled log code in #ifdef UNIV_LOG_REPLICATE or UNIV_LOG_ARCHIVE innobase/mem/mem0dbg.c: Add const qualifiers to string parameters innobase/page/page0page.c: Remove (char*) casts of string constants innobase/pars/pars0pars.c: Add const qualifier to string variable innobase/row/row0ins.c: Remove (char*) casts of string constants Add const qualifiers to string parameters row_ins_foreign_check_on_constraint(): Allocate table_name dynamically innobase/row/row0mysql.c: Remove (char*) casts of string constants innobase/row/row0sel.c: Remove (char*) casts of string constants innobase/srv/srv0srv.c: Remove (char*) casts of string constants Disable log archiving variables unless #ifdef UNIV_LOG_ARCHIVE innobase/srv/srv0start.c: Disable log archiving code unless #ifdef UNIV_LOG_ARCHIVE Remove (char*) casts of string constants innobase/sync/sync0rw.c: Remove (char*) casts of string constants Add const qualifier to string parameter innobase/sync/sync0sync.c: Remove (char*) cast of string constant Add const qualifier to string parameter innobase/trx/trx0roll.c: Remove (char*) cast of string constants innobase/trx/trx0sys.c: Remove (char*) cast of string constants innobase/trx/trx0trx.c: Remove (char*) cast of string constant sql/ha_innodb.cc: Enclose log archiving code in #ifdef UNIV_LOG_ARCHIVE
94 lines
2.9 KiB
Text
94 lines
2.9 KiB
Text
/************************************************************************
|
|
The memory management: the debug code. This is not an independent
|
|
compilation module but is included in mem0mem.*.
|
|
|
|
(c) 1994, 1995 Innobase Oy
|
|
|
|
Created 6/8/1994 Heikki Tuuri
|
|
*************************************************************************/
|
|
|
|
#ifdef UNIV_MEM_DEBUG
|
|
extern mutex_t mem_hash_mutex;
|
|
extern ulint mem_current_allocated_memory;
|
|
|
|
/**********************************************************************
|
|
Initializes an allocated memory field in the debug version. */
|
|
|
|
void
|
|
mem_field_init(
|
|
/*===========*/
|
|
byte* buf, /* in: memory field */
|
|
ulint n); /* in: how many bytes the user requested */
|
|
/**********************************************************************
|
|
Erases an allocated memory field in the debug version. */
|
|
|
|
void
|
|
mem_field_erase(
|
|
/*============*/
|
|
byte* buf, /* in: memory field */
|
|
ulint n); /* in: how many bytes the user requested */
|
|
/*******************************************************************
|
|
Initializes a buffer to a random combination of hex BA and BE.
|
|
Used to initialize allocated memory. */
|
|
|
|
void
|
|
mem_init_buf(
|
|
/*=========*/
|
|
byte* buf, /* in: pointer to buffer */
|
|
ulint n); /* in: length of buffer */
|
|
/*******************************************************************
|
|
Initializes a buffer to a random combination of hex DE and AD.
|
|
Used to erase freed memory.*/
|
|
|
|
void
|
|
mem_erase_buf(
|
|
/*==========*/
|
|
byte* buf, /* in: pointer to buffer */
|
|
ulint n); /* in: length of buffer */
|
|
/*******************************************************************
|
|
Inserts a created memory heap to the hash table of
|
|
current allocated memory heaps.
|
|
Initializes the hash table when first called. */
|
|
|
|
void
|
|
mem_hash_insert(
|
|
/*============*/
|
|
mem_heap_t* heap, /* in: the created heap */
|
|
const char* file_name, /* in: file name of creation */
|
|
ulint line); /* in: line where created */
|
|
#ifdef UNIV_MEM_DEBUG
|
|
/*******************************************************************
|
|
Removes a memory heap (which is going to be freed by the caller)
|
|
from the list of live memory heaps. Returns the size of the heap
|
|
in terms of how much memory in bytes was allocated for the user of
|
|
the heap (not the total space occupied by the heap).
|
|
Also validates the heap.
|
|
NOTE: This function does not free the storage occupied by the
|
|
heap itself, only the node in the list of heaps. */
|
|
|
|
void
|
|
mem_hash_remove(
|
|
/*============*/
|
|
mem_heap_t* heap, /* in: the heap to be freed */
|
|
const char* file_name, /* in: file name of freeing */
|
|
ulint line); /* in: line where freed */
|
|
#endif /* UNIV_MEM_DEBUG */
|
|
|
|
void
|
|
mem_field_header_set_len(byte* field, ulint len);
|
|
|
|
ulint
|
|
mem_field_header_get_len(byte* field);
|
|
|
|
void
|
|
mem_field_header_set_check(byte* field, ulint check);
|
|
|
|
ulint
|
|
mem_field_header_get_check(byte* field);
|
|
|
|
void
|
|
mem_field_trailer_set_check(byte* field, ulint check);
|
|
|
|
ulint
|
|
mem_field_trailer_get_check(byte* field);
|
|
#endif /* UNIV_MEM_DEBUG */
|