File memory_alloc.h¶
FileList > base > memory_alloc.h
Go to the source code of this file
#include "config.h"#include "dbtype_def.h"#include "thread_compat.hpp"#include <stdio.h>#include <stdlib.h>#include <limits.h>#include <sys/types.h>#include <stddef.h>#include <string.h>#include <stdint.h>#include <memory>#include <functional>#include "memory_cwrapper.h"
Classes¶
| Type | Name |
|---|---|
| struct | private_malloc_header_s |
Public Types¶
| Type | Name |
|---|---|
| typedef struct private_malloc_header_s | PRIVATE_MALLOC_HEADER |
| enum | memory__alloc_8h_1abed82baf7f470b522273a3e37c24c600 |
Public Functions¶
Macros¶
| Type | Name |
|---|---|
| define | CEIL_PTVDIV (dividend, divisor) ((([**dividend**](broker__monitor_8c.md#function-timeout)) == 0) ? 0 : ((([**dividend**](broker__monitor_8c.md#function-timeout)) - 1) / ([**divisor**](broker__monitor_8c.md#function-timeout))) + 1) |
| define | CHAR_ALIGNMENT [**sizeof**](broker__monitor_8c.md#function-timeout)([**char**](broker__monitor_8c.md#function-timeout)) |
| define | DB_ALIGN (offset, align) (((offset) + (align) - 1) & ~((align) - 1)) |
| define | DB_ALIGN_BELOW (offset, align) ((offset) & ~((align) - 1)) |
| define | DB_ATT_ALIGN (offset) (((offset) + ([**INT\_ALIGNMENT**](memory__alloc_8h.md#define-int_alignment)) - 1) & ~(([**INT\_ALIGNMENT**](memory__alloc_8h.md#define-int_alignment)) - 1)) |
| define | DB_SIZEOF (val) ([**sizeof**](broker__monitor_8c.md#function-timeout)(val)) |
| define | DB_WASTED_ALIGN (offset, align) ([**DB\_ALIGN**](memory__alloc_8h.md#define-db_align)((offset), (align)) - (offset)) |
| define | DOUBLE_ALIGNMENT [**sizeof**](broker__monitor_8c.md#function-timeout)([**double**](broker__monitor_8c.md#function-timeout)) |
| define | FLOAT_ALIGNMENT [**sizeof**](broker__monitor_8c.md#function-timeout)([**float**](broker__monitor_8c.md#function-timeout)) |
| define | INT_ALIGNMENT [**sizeof**](broker__monitor_8c.md#function-timeout)([**int**](broker__monitor_8c.md#function-timeout)) |
| define | LONG_ALIGNMENT [**sizeof**](broker__monitor_8c.md#function-timeout)([**long**](broker__monitor_8c.md#function-timeout)) |
| define | MAX_ALIGNMENT [**DOUBLE\_ALIGNMENT**](memory__alloc_8h.md#define-double_alignment) |
| define | MEM_REGION_GUARD_MARK '\02' /\* [**Set**](broker__monitor_8c.md#function-timeout) [**this**](broker__monitor_8c.md#function-timeout) [**as**](broker__monitor_8c.md#function-timeout) [**a**](broker__monitor_8c.md#function-timeout) memory [**guard**](broker__monitor_8c.md#function-timeout) to [**detect**](broker__monitor_8c.md#function-timeout) [**over**](broker__monitor_8c.md#function-timeout)/[**under**](broker__monitor_8c.md#function-timeout) [**runs**](broker__monitor_8c.md#function-timeout) \*/ |
| define | MEM_REGION_INIT (region, size) [**memset**](broker__monitor_8c.md#function-timeout)(([**region**](broker__monitor_8c.md#function-timeout)), [**MEM\_REGION\_SCRAMBLE\_MARK**](memory__alloc_8h.md#define-mem_region_scramble_mark), (size)) |
| define | MEM_REGION_INIT_MARK '\0' /\* [**Set**](broker__monitor_8c.md#function-timeout) [**this**](broker__monitor_8c.md#function-timeout) to [**allocated**](broker__monitor_8c.md#function-timeout) areas \*/ |
| define | MEM_REGION_SCRAMBLE (region, size) [**memset**](broker__monitor_8c.md#function-timeout) ([**region**](broker__monitor_8c.md#function-timeout), [**MEM\_REGION\_SCRAMBLE\_MARK**](memory__alloc_8h.md#define-mem_region_scramble_mark), size) |
| define | MEM_REGION_SCRAMBLE_MARK '\01' /\* [**Set**](broker__monitor_8c.md#function-timeout) [**this**](broker__monitor_8c.md#function-timeout) to [**allocated**](broker__monitor_8c.md#function-timeout) areas \*/ |
| define | PRIVATE_MALLOC_HEADER_ALIGNED_SIZE (([**sizeof**](broker__monitor_8c.md#function-timeout)([**PRIVATE\_MALLOC\_HEADER**](memory__alloc_8h.md#typedef-private_malloc_header)) + 7) & ~7) |
| define | PRIVATE_MALLOC_HEADER_MAGIC 0xafdaafdaU |
| define | PTR_ALIGN (addr, boundary) /* multi line expression */ |
| define | PTR_ALIGNMENT 8 |
| define | SHORT_ALIGNMENT [**sizeof**](broker__monitor_8c.md#function-timeout)([**short**](broker__monitor_8c.md#function-timeout)) |
| define | db_private_alloc (thrd, size) [**db\_private\_alloc\_debug**](memory__alloc_8c.md#function-db_private_alloc_debug)(thrd, size, [**true**](broker__monitor_8c.md#function-timeout), [**\_\_FILE\_\_**](broker__monitor_8c.md#function-timeout), [**\_\_LINE\_\_**](broker__monitor_8c.md#function-timeout)) |
| define | db_private_free (thrd, ptr) [**db\_private\_free\_debug**](memory__alloc_8c.md#function-db_private_free_debug)(thrd, ptr, [**true**](broker__monitor_8c.md#function-timeout), [**\_\_FILE\_\_**](broker__monitor_8c.md#function-timeout), [**\_\_LINE\_\_**](broker__monitor_8c.md#function-timeout)) |
| define | db_private_free_and_init (thrd, ptr) /* multi line expression */ |
| define | db_private_realloc (thrd, ptr, size) [**db\_private\_realloc\_debug**](memory__alloc_8c.md#function-db_private_realloc_debug)(thrd, ptr, size, [**true**](broker__monitor_8c.md#function-timeout), [**\_\_FILE\_\_**](broker__monitor_8c.md#function-timeout), [**\_\_LINE\_\_**](broker__monitor_8c.md#function-timeout)) |
| define | free_and_init (ptr) /* multi line expression */ |
| define | os_calloc (n, size) [**os\_calloc\_debug**](memory__alloc_8c.md#function-os_calloc_debug)(n, size, [**true**](broker__monitor_8c.md#function-timeout), [**\_\_FILE\_\_**](broker__monitor_8c.md#function-timeout), [**\_\_LINE\_\_**](broker__monitor_8c.md#function-timeout)) |
| define | os_free (ptr) [**os\_free\_debug**](memory__alloc_8c.md#function-os_free_debug)(ptr, [**true**](broker__monitor_8c.md#function-timeout), [**\_\_FILE\_\_**](broker__monitor_8c.md#function-timeout), [**\_\_LINE\_\_**](broker__monitor_8c.md#function-timeout)) |
| define | os_free_and_init (ptr) /* multi line expression */ |
| define | os_malloc (size) [**os\_malloc\_debug**](memory__alloc_8c.md#function-os_malloc_debug)(size, [**true**](broker__monitor_8c.md#function-timeout), [**\_\_FILE\_\_**](broker__monitor_8c.md#function-timeout), [**\_\_LINE\_\_**](broker__monitor_8c.md#function-timeout)) |
| define | os_realloc (ptr, size) ([**realloc**](memory__cwrapper_8h.md#define-realloc) ((ptr), (size))) |
| define | private_hl2user_ptr (ptr) ([**void**](broker__monitor_8c.md#function-timeout) \*)(([**char**](broker__monitor_8c.md#function-timeout) \*)(ptr) + [**PRIVATE\_MALLOC\_HEADER\_ALIGNED\_SIZE**](memory__alloc_8h.md#define-private_malloc_header_aligned_size)) |
| define | private_request_size (s) ([**PRIVATE\_MALLOC\_HEADER\_ALIGNED\_SIZE**](memory__alloc_8h.md#define-private_malloc_header_aligned_size) + (s)) |
| define | private_user2hl_ptr (ptr) ([**PRIVATE\_MALLOC\_HEADER**](memory__alloc_8h.md#typedef-private_malloc_header) \*)(([**char**](broker__monitor_8c.md#function-timeout) \*)(ptr) - [**PRIVATE\_MALLOC\_HEADER\_ALIGNED\_SIZE**](memory__alloc_8h.md#define-private_malloc_header_aligned_size)) |
Public Types Documentation¶
typedef PRIVATE_MALLOC_HEADER¶
enum memory__alloc_8h_1abed82baf7f470b522273a3e37c24c600¶
enum memory__alloc_8h_1abed82baf7f470b522273a3e37c24c600 {
PRIVATE_ALLOC_TYPE_LEA = 1,
PRIVATE_ALLOC_TYPE_WS = 2
};
Public Functions Documentation¶
function ansisql_strcasecmp¶
function ansisql_strcmp¶
function db_align_to¶
function db_alignment¶
function db_change_private_heap¶
function db_clear_private_heap¶
function db_create_fixed_heap¶
function db_create_ostk_heap¶
function db_create_private_heap¶
function db_destroy_fixed_heap¶
function db_destroy_ostk_heap¶
function db_destroy_private_heap¶
function db_fixed_alloc¶
function db_fixed_free¶
function db_ostk_alloc¶
function db_ostk_free¶
function db_private_alloc_debug¶
void * db_private_alloc_debug (
THREAD_ENTRY * thrd,
size_t size,
bool rc_track,
const char * caller_file,
int caller_line
)
function db_private_alloc_external¶
function db_private_free_debug¶
void db_private_free_debug (
THREAD_ENTRY * thrd,
void * ptr,
bool rc_track,
const char * caller_file,
int caller_line
)
function db_private_free_external¶
function db_private_realloc_debug¶
void * db_private_realloc_debug (
THREAD_ENTRY * thrd,
void * ptr,
size_t size,
bool rc_track,
const char * caller_file,
int caller_line
)
function db_private_realloc_external¶
function db_private_set_heapid_to_thread¶
function db_private_strdup¶
function db_private_strndup¶
function db_replace_private_heap¶
function db_scramble¶
function os_calloc_debug¶
void * os_calloc_debug (
size_t n,
size_t size,
bool rc_track,
const char * caller_file,
int caller_line
)
function os_free_debug¶
function os_malloc_debug¶
Macro Definition Documentation¶
define CEIL_PTVDIV¶
#define CEIL_PTVDIV (
dividend,
divisor
) `((( dividend ) == 0) ? 0 : ((( dividend ) - 1) / ( divisor )) + 1)`
define CHAR_ALIGNMENT¶
define DB_ALIGN¶
define DB_ALIGN_BELOW¶
define DB_ATT_ALIGN¶
define DB_SIZEOF¶
define DB_WASTED_ALIGN¶
define DOUBLE_ALIGNMENT¶
define FLOAT_ALIGNMENT¶
define INT_ALIGNMENT¶
define LONG_ALIGNMENT¶
define MAX_ALIGNMENT¶
define MEM_REGION_GUARD_MARK¶
define MEM_REGION_INIT¶
define MEM_REGION_INIT_MARK¶
define MEM_REGION_SCRAMBLE¶
define MEM_REGION_SCRAMBLE_MARK¶
define PRIVATE_MALLOC_HEADER_ALIGNED_SIZE¶
define PRIVATE_MALLOC_HEADER_MAGIC¶
define PTR_ALIGN¶
define PTR_ALIGNMENT¶
define SHORT_ALIGNMENT¶
define db_private_alloc¶
#define db_private_alloc (
thrd,
size
) `db_private_alloc_debug (thrd, size, true , __FILE__ , __LINE__ )`
define db_private_free¶
#define db_private_free (
thrd,
ptr
) `db_private_free_debug (thrd, ptr, true , __FILE__ , __LINE__ )`
define db_private_free_and_init¶
define db_private_realloc¶
#define db_private_realloc (
thrd,
ptr,
size
) `db_private_realloc_debug (thrd, ptr, size, true , __FILE__ , __LINE__ )`
define free_and_init¶
define os_calloc¶
define os_free¶
define os_free_and_init¶
define os_malloc¶
define os_realloc¶
define private_hl2user_ptr¶
#define private_hl2user_ptr (
ptr
) `( void *)(( char *)(ptr) + PRIVATE_MALLOC_HEADER_ALIGNED_SIZE )`
define private_request_size¶
define private_user2hl_ptr¶
#define private_user2hl_ptr (
ptr
) `( PRIVATE_MALLOC_HEADER *)(( char *)(ptr) - PRIVATE_MALLOC_HEADER_ALIGNED_SIZE )`
The documentation for this class was generated from the following file cubrid/src/base/memory_alloc.h