CUBRID Engine
latest
|
#include <stdlib.h>
#include <stddef.h>
#include "customheaps.h"
#include "error_manager.h"
#include "system_parameter.h"
#include "malloc_2_8_3.c"
Go to the source code of this file.
Classes | |
struct | mmap_trace_h_s |
struct | hl_mspace_s |
Macros | |
#define | USE_MALLOC_INSTEAD 1 |
#define | MOCK_LEA_HEAP_ID ((UINTPTR)(-1)) |
#define | system_malloc my_malloc |
#define | system_free my_free |
#define | DEFAULT_GRANULARITY (32U*1024U) |
#define | ONLY_MSPACES 1 |
#define | MMAP_TRACE_H_SIZE sizeof(MMAP_TRACE_H) |
#define | MMAP_TRACE_H_INIT(h, p) |
#define | MMAP_TRACE_H_REMOVE(h) |
#define | MMAP_TRACE_H_ADD(p, h) |
#define | ENABLE_SEPARATE_MMAP_EVENT_TRACE |
#define | mspace2hlmspace(m) (HL_MSPACE *)((char *)mem2chunk(m) - ((sizeof (HL_MSPACE) + 7U) & ~7U)) |
#define | LEA_HEAP_BASE_SIZE (64U*1024U) |
Typedefs | |
typedef struct mmap_trace_h_s | MMAP_TRACE_H |
typedef struct hl_mspace_s | HL_MSPACE |
Functions | |
static void * | my_malloc (size_t sz) |
static int | my_free (void *p) |
static void | mmap_called (void *m, void *ptr, MMAP_TRACE_H *h) |
static void | munmap_is_to_be_called (void *m, void *ptr, MMAP_TRACE_H *h) |
UINTPTR | hl_register_lea_heap (void) |
static void | destroy_mspace_internal (HL_MSPACE *hms) |
void | hl_clear_lea_heap (UINTPTR heap_id) |
void | hl_unregister_lea_heap (UINTPTR heap_id) |
void * | hl_lea_alloc (UINTPTR heap_id, size_t sz) |
void * | hl_lea_realloc (UINTPTR heap_id, void *ptr, size_t sz) |
void | hl_lea_free (UINTPTR heap_id, void *ptr) |
#define DEFAULT_GRANULARITY (32U*1024U) |
Definition at line 58 of file lea_heap.c.
#define ENABLE_SEPARATE_MMAP_EVENT_TRACE |
Definition at line 113 of file lea_heap.c.
#define LEA_HEAP_BASE_SIZE (64U*1024U) |
Definition at line 206 of file lea_heap.c.
Referenced by hl_register_lea_heap().
#define MMAP_TRACE_H_ADD | ( | p, | |
h | |||
) |
Definition at line 101 of file lea_heap.c.
Referenced by mmap_called().
#define MMAP_TRACE_H_INIT | ( | h, | |
p | |||
) |
Definition at line 89 of file lea_heap.c.
Referenced by hl_register_lea_heap(), and mmap_called().
#define MMAP_TRACE_H_REMOVE | ( | h | ) |
Definition at line 95 of file lea_heap.c.
Referenced by destroy_mspace_internal(), and munmap_is_to_be_called().
#define MMAP_TRACE_H_SIZE sizeof(MMAP_TRACE_H) |
Definition at line 87 of file lea_heap.c.
Referenced by dlmallopt(), mmap_alloc(), and mmap_resize().
#define MOCK_LEA_HEAP_ID ((UINTPTR)(-1)) |
Definition at line 48 of file lea_heap.c.
Referenced by hl_clear_lea_heap(), hl_register_lea_heap(), and hl_unregister_lea_heap().
#define mspace2hlmspace | ( | m | ) | (HL_MSPACE *)((char *)mem2chunk(m) - ((sizeof (HL_MSPACE) + 7U) & ~7U)) |
Definition at line 170 of file lea_heap.c.
Referenced by mmap_called(), and munmap_is_to_be_called().
#define ONLY_MSPACES 1 |
Definition at line 72 of file lea_heap.c.
#define system_free my_free |
Definition at line 50 of file lea_heap.c.
#define system_malloc my_malloc |
Definition at line 49 of file lea_heap.c.
#define USE_MALLOC_INSTEAD 1 |
Definition at line 47 of file lea_heap.c.
typedef struct hl_mspace_s HL_MSPACE |
Definition at line 151 of file lea_heap.c.
typedef struct mmap_trace_h_s MMAP_TRACE_H |
Definition at line 79 of file lea_heap.c.
|
static |
Definition at line 252 of file lea_heap.c.
References hl_mspace_s::header, MMAP_TRACE_H_REMOVE, hl_mspace_s::ms, my_free(), mmap_trace_h_s::next, NULL, and mmap_trace_h_s::ptr.
Referenced by hl_clear_lea_heap(), and hl_unregister_lea_heap().
void hl_clear_lea_heap | ( | UINTPTR | heap_id | ) |
Definition at line 272 of file lea_heap.c.
References assert, hl_mspace_s::base, hl_mspace_s::base_size, destroy_mspace_internal(), MOCK_LEA_HEAP_ID, hl_mspace_s::ms, NULL, prm_get_bool_value(), and PRM_ID_USE_SYSTEM_MALLOC.
Referenced by db_clear_private_heap().
void* hl_lea_alloc | ( | UINTPTR | heap_id, |
size_t | sz | ||
) |
Definition at line 326 of file lea_heap.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), hl_mspace_s::ms, NULL, p, prm_get_bool_value(), and PRM_ID_USE_SYSTEM_MALLOC.
Referenced by db_private_alloc_debug(), and db_ws_alloc().
void hl_lea_free | ( | UINTPTR | heap_id, |
void * | ptr | ||
) |
Definition at line 395 of file lea_heap.c.
References hl_mspace_s::ms, NULL, prm_get_bool_value(), and PRM_ID_USE_SYSTEM_MALLOC.
Referenced by db_private_free_debug(), and db_ws_free().
void* hl_lea_realloc | ( | UINTPTR | heap_id, |
void * | ptr, | ||
size_t | sz | ||
) |
Definition at line 361 of file lea_heap.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), hl_mspace_s::ms, NULL, p, prm_get_bool_value(), and PRM_ID_USE_SYSTEM_MALLOC.
Referenced by db_private_realloc_debug(), and db_ws_realloc().
UINTPTR hl_register_lea_heap | ( | void | ) |
Definition at line 213 of file lea_heap.c.
References hl_mspace_s::base, hl_mspace_s::base_size, hl_mspace_s::header, LEA_HEAP_BASE_SIZE, MMAP_TRACE_H_INIT, MOCK_LEA_HEAP_ID, hl_mspace_s::ms, NULL, prm_get_bool_value(), and PRM_ID_USE_SYSTEM_MALLOC.
Referenced by db_create_private_heap(), and db_create_workspace_heap().
void hl_unregister_lea_heap | ( | UINTPTR | heap_id | ) |
Definition at line 299 of file lea_heap.c.
References assert, destroy_mspace_internal(), MOCK_LEA_HEAP_ID, NULL, prm_get_bool_value(), and PRM_ID_USE_SYSTEM_MALLOC.
Referenced by db_destroy_private_heap(), and db_destroy_workspace_heap().
|
static |
Definition at line 182 of file lea_heap.c.
References hl_mspace_s::header, MMAP_TRACE_H_ADD, MMAP_TRACE_H_INIT, and mspace2hlmspace.
Referenced by mmap_alloc().
|
static |
Definition at line 198 of file lea_heap.c.
References assert, MMAP_TRACE_H_REMOVE, mspace2hlmspace, and mmap_trace_h_s::ptr.
Referenced by dlmallopt().
|
static |
Definition at line 141 of file lea_heap.c.
Referenced by destroy_mspace_internal().
|
static |
Definition at line 122 of file lea_heap.c.
References CMFAIL, NULL, and mmap_trace_h_s::ptr.