Skip to content

File lea_heap.c

FileList > cubrid > src > heaplayers > lea_heap.c

Go to the source code of this file

  • #include <stdlib.h>
  • #include <stddef.h>
  • #include "customheaps.h"
  • #include "error_manager.h"
  • #include "system_parameter.h"
  • #include "memory_wrapper.hpp"
  • #include "malloc_2_8_3.c"

Classes

Type Name
struct hl_mspace_s
struct mmap_trace_h_s

Public Types

Type Name
typedef struct hl_mspace_s HL_MSPACE
typedef struct mmap_trace_h_s MMAP_TRACE_H

Public Functions

Type Name
void hl_clear_lea_heap (UINTPTR heap_id)
void * hl_lea_alloc (UINTPTR heap_id, size_t sz)
void hl_lea_free (UINTPTR heap_id, void * ptr)
void * hl_lea_realloc (UINTPTR heap_id, void * ptr, size_t sz)
UINTPTR hl_register_lea_heap (void)
void hl_unregister_lea_heap (UINTPTR heap_id)

Public Static Functions

Type Name
void destroy_mspace_internal (HL_MSPACE * hms)
void mmap_called (void * m, void * ptr, MMAP_TRACE_H * h)
void munmap_is_to_be_called (void * m, void * ptr, MMAP_TRACE_H * h)
int my_free (void * p)
void * my_malloc (size_t sz)

Macros

Type Name
define DEFAULT_GRANULARITY (32[**U**](broker__monitor_8c.md#function-timeout)\*1024[**U**](broker__monitor_8c.md#function-timeout))
define ENABLE_SEPARATE_MMAP_EVENT_TRACE
define LEA_HEAP_BASE_SIZE (64[**U**](broker__monitor_8c.md#function-timeout)\*1024[**U**](broker__monitor_8c.md#function-timeout))
define MMAP_TRACE_H_ADD (p, h) /* multi line expression */
define MMAP_TRACE_H_INIT (h, p) /* multi line expression */
define MMAP_TRACE_H_REMOVE (h) /* multi line expression */
define MMAP_TRACE_H_SIZE [**sizeof**](broker__monitor_8c.md#function-timeout)([**MMAP\_TRACE\_H**](lea__heap_8c.md#typedef-mmap_trace_h))
define MOCK_LEA_HEAP_ID (([**UINTPTR**](broker__monitor_8c.md#function-timeout))(-1))
define ONLY_MSPACES 1
define USE_MALLOC_INSTEAD 1
define mspace2hlmspace (m) ([**HL\_MSPACE**](lea__heap_8c.md#typedef-hl_mspace) \*)(([**char**](broker__monitor_8c.md#function-timeout) \*)[**mem2chunk**](malloc__2__8__3_8c.md#define-mem2chunk)(m) - (([**sizeof**](broker__monitor_8c.md#function-timeout) ([**HL\_MSPACE**](lea__heap_8c.md#typedef-hl_mspace)) + 7[**U**](broker__monitor_8c.md#function-timeout)) & ~7[**U**](broker__monitor_8c.md#function-timeout)))
define system_free [**my\_free**](lea__heap_8c.md#function-my_free)
define system_malloc [**my\_malloc**](lea__heap_8c.md#function-my_malloc)

Public Types Documentation

typedef HL_MSPACE

typedef struct hl_mspace_s HL_MSPACE;

typedef MMAP_TRACE_H

typedef struct mmap_trace_h_s MMAP_TRACE_H;

Public Functions Documentation

function hl_clear_lea_heap

void hl_clear_lea_heap (
    UINTPTR heap_id
) 

function hl_lea_alloc

void * hl_lea_alloc (
    UINTPTR heap_id,
    size_t sz
) 

function hl_lea_free

void hl_lea_free (
    UINTPTR heap_id,
    void * ptr
) 

function hl_lea_realloc

void * hl_lea_realloc (
    UINTPTR heap_id,
    void * ptr,
    size_t sz
) 

function hl_register_lea_heap

UINTPTR hl_register_lea_heap (
    void
) 

function hl_unregister_lea_heap

void hl_unregister_lea_heap (
    UINTPTR heap_id
) 

Public Static Functions Documentation

function destroy_mspace_internal

static void destroy_mspace_internal (
    HL_MSPACE * hms
) 

function mmap_called

static void mmap_called (
    void * m,
    void * ptr,
    MMAP_TRACE_H * h
) 

function munmap_is_to_be_called

static void munmap_is_to_be_called (
    void * m,
    void * ptr,
    MMAP_TRACE_H * h
) 

function my_free

static int my_free (
    void * p
) 

function my_malloc

static void * my_malloc (
    size_t sz
) 

Macro Definition Documentation

define DEFAULT_GRANULARITY

#define DEFAULT_GRANULARITY `(32 U *1024 U )`

define ENABLE_SEPARATE_MMAP_EVENT_TRACE

#define ENABLE_SEPARATE_MMAP_EVENT_TRACE 

define LEA_HEAP_BASE_SIZE

#define LEA_HEAP_BASE_SIZE `(64 U *1024 U )`

define MMAP_TRACE_H_ADD

#define MMAP_TRACE_H_ADD (
    p,
    h
) `/* multi line expression */`

define MMAP_TRACE_H_INIT

#define MMAP_TRACE_H_INIT (
    h,
    p
) `/* multi line expression */`

define MMAP_TRACE_H_REMOVE

#define MMAP_TRACE_H_REMOVE (
    h
) `/* multi line expression */`

define MMAP_TRACE_H_SIZE

#define MMAP_TRACE_H_SIZE `sizeof ( MMAP_TRACE_H )`

define MOCK_LEA_HEAP_ID

#define MOCK_LEA_HEAP_ID `(( UINTPTR )(-1))`

define ONLY_MSPACES

#define ONLY_MSPACES `1`

define USE_MALLOC_INSTEAD

#define USE_MALLOC_INSTEAD `1`

define mspace2hlmspace

#define mspace2hlmspace (
    m
) `( HL_MSPACE *)(( char *) mem2chunk (m) - (( sizeof ( HL_MSPACE ) + 7 U ) & ~7 U ))`

define system_free

#define system_free `my_free`

define system_malloc

#define system_malloc `my_malloc`


The documentation for this class was generated from the following file cubrid/src/heaplayers/lea_heap.c