FD.io VPP  v20.05.1-6-gf53edbc3b
Vector Packet Processing
dlmalloc.h File Reference
+ Include dependency graph for dlmalloc.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dlmallinfo
 

Macros

#define FOOTERS   1 /* extra debugging */
 
#define DLM_MAGIC_CONSTANT   0xdeaddabe
 
#define USE_LOCKS   1
 
#define DLM_ABORT   {extern void os_panic(void); os_panic(); abort();}
 
#define ONLY_MSPACES   1
 
#define DLMALLOC_VERSION   20806
 
#define DLMALLOC_EXPORT   extern
 
#define MAX_SIZE_T   (~(size_t)0)
 
#define MSPACES   1
 
#define MALLOC_ALIGNMENT   ((size_t)(2 * sizeof(void *)))
 
#define DLM_ABORT_ON_ASSERT_FAILURE   1
 
#define PROCEED_ON_ERROR   0
 
#define INSECURE   0
 
#define MALLOC_INSPECT_ALL   0
 
#define HAVE_MMAP   1
 
#define MMAP_CLEARS   1
 
#define HAVE_MREMAP   0
 
#define MALLOC_FAILURE_ACTION   errno = ENOMEM;
 
#define HAVE_MORECORE   0
 
#define MORECORE_CONTIGUOUS   0
 
#define DEFAULT_GRANULARITY   ((size_t)64U * (size_t)1024U)
 
#define DEFAULT_TRIM_THRESHOLD   ((size_t)2U * (size_t)1024U * (size_t)1024U)
 
#define DEFAULT_MMAP_THRESHOLD   ((size_t)~0ULL)
 
#define MAX_RELEASE_CHECK_RATE   4095
 
#define USE_BUILTIN_FFS   0
 
#define USE_DEV_RANDOM   0
 
#define NO_MALLINFO   0
 
#define MALLINFO_FIELD_TYPE   size_t
 
#define NO_MALLOC_STATS   0
 
#define NO_SEGMENT_TRAVERSAL   0
 
#define M_TRIM_THRESHOLD   (-1)
 
#define M_GRANULARITY   (-2)
 
#define M_MMAP_THRESHOLD   (-3)
 
#define STRUCT_MALLINFO_DECLARED   1
 
#define NOINLINE
 
#define FORCEINLINE
 

Typedefs

typedef void * mspace
 

Functions

DLMALLOC_EXPORT mspace create_mspace (size_t capacity, int locked)
 
DLMALLOC_EXPORT size_t destroy_mspace (mspace msp)
 
DLMALLOC_EXPORT mspace create_mspace_with_base (void *base, size_t capacity, int locked)
 
DLMALLOC_EXPORT int mspace_track_large_chunks (mspace msp, int enable)
 
DLMALLOC_EXPORT void * mspace_malloc (mspace msp, size_t bytes)
 
DLMALLOC_EXPORT void mspace_free (mspace msp, void *mem)
 
DLMALLOC_EXPORT void * mspace_realloc (mspace msp, void *mem, size_t newsize)
 
DLMALLOC_EXPORT void * mspace_calloc (mspace msp, size_t n_elements, size_t elem_size)
 
DLMALLOC_EXPORT void * mspace_memalign (mspace msp, size_t alignment, size_t bytes)
 
DLMALLOC_EXPORT void ** mspace_independent_calloc (mspace msp, size_t n_elements, size_t elem_size, void *chunks[])
 
DLMALLOC_EXPORT void ** mspace_independent_comalloc (mspace msp, size_t n_elements, size_t sizes[], void *chunks[])
 
DLMALLOC_EXPORT size_t mspace_footprint (mspace msp)
 
DLMALLOC_EXPORT size_t mspace_max_footprint (mspace msp)
 
DLMALLOC_EXPORT struct dlmallinfo mspace_mallinfo (mspace msp)
 
DLMALLOC_EXPORT size_t mspace_usable_size (const void *mem)
 
DLMALLOC_EXPORT void mspace_malloc_stats (mspace msp)
 
DLMALLOC_EXPORT int mspace_trim (mspace msp, size_t pad)
 
DLMALLOC_EXPORT int mspace_mallopt (int, int)
 
DLMALLOC_EXPORT void * mspace_get_aligned (mspace msp, unsigned long n_user_data_bytes, unsigned long align, unsigned long align_offset)
 
DLMALLOC_EXPORT int mspace_is_heap_object (mspace msp, void *p)
 
DLMALLOC_EXPORT void mspace_get_address_and_size (mspace msp, char **addrp, size_t *sizep)
 
DLMALLOC_EXPORT void mspace_put (mspace msp, void *p)
 
DLMALLOC_EXPORT void mspace_put_no_offset (mspace msp, void *p)
 
DLMALLOC_EXPORT size_t mspace_usable_size_with_delta (const void *p)
 
DLMALLOC_EXPORT void mspace_disable_expand (mspace msp)
 
DLMALLOC_EXPORT void * mspace_least_addr (mspace msp)
 
DLMALLOC_EXPORT void mheap_get_trace (uword offset, uword size)
 
DLMALLOC_EXPORT void mheap_put_trace (uword offset, uword size)
 
DLMALLOC_EXPORT int mspace_enable_disable_trace (mspace msp, int enable)
 
DLMALLOC_EXPORT int mspace_is_traced (mspace msp)
 

Macro Definition Documentation

◆ DEFAULT_GRANULARITY

#define DEFAULT_GRANULARITY   ((size_t)64U * (size_t)1024U)

Definition at line 690 of file dlmalloc.h.

◆ DEFAULT_MMAP_THRESHOLD

#define DEFAULT_MMAP_THRESHOLD   ((size_t)~0ULL)

Definition at line 723 of file dlmalloc.h.

◆ DEFAULT_TRIM_THRESHOLD

#define DEFAULT_TRIM_THRESHOLD   ((size_t)2U * (size_t)1024U * (size_t)1024U)

Definition at line 695 of file dlmalloc.h.

◆ DLM_ABORT

#define DLM_ABORT   {extern void os_panic(void); os_panic(); abort();}

Definition at line 534 of file dlmalloc.h.

◆ DLM_ABORT_ON_ASSERT_FAILURE

#define DLM_ABORT_ON_ASSERT_FAILURE   1

Definition at line 642 of file dlmalloc.h.

◆ DLM_MAGIC_CONSTANT

#define DLM_MAGIC_CONSTANT   0xdeaddabe

Definition at line 531 of file dlmalloc.h.

◆ DLMALLOC_EXPORT

#define DLMALLOC_EXPORT   extern

Definition at line 545 of file dlmalloc.h.

◆ DLMALLOC_VERSION

#define DLMALLOC_VERSION   20806

Definition at line 541 of file dlmalloc.h.

◆ FOOTERS

#define FOOTERS   1 /* extra debugging */

Definition at line 530 of file dlmalloc.h.

◆ FORCEINLINE

#define FORCEINLINE

Definition at line 844 of file dlmalloc.h.

◆ HAVE_MMAP

#define HAVE_MMAP   1

Definition at line 655 of file dlmalloc.h.

◆ HAVE_MORECORE

#define HAVE_MORECORE   0

Definition at line 673 of file dlmalloc.h.

◆ HAVE_MREMAP

#define HAVE_MREMAP   0

Definition at line 665 of file dlmalloc.h.

◆ INSECURE

#define INSECURE   0

Definition at line 649 of file dlmalloc.h.

◆ M_GRANULARITY

#define M_GRANULARITY   (-2)

Definition at line 762 of file dlmalloc.h.

◆ M_MMAP_THRESHOLD

#define M_MMAP_THRESHOLD   (-3)

Definition at line 763 of file dlmalloc.h.

◆ M_TRIM_THRESHOLD

#define M_TRIM_THRESHOLD   (-1)

Definition at line 761 of file dlmalloc.h.

◆ MALLINFO_FIELD_TYPE

#define MALLINFO_FIELD_TYPE   size_t

Definition at line 745 of file dlmalloc.h.

◆ MALLOC_ALIGNMENT

#define MALLOC_ALIGNMENT   ((size_t)(2 * sizeof(void *)))

Definition at line 633 of file dlmalloc.h.

◆ MALLOC_FAILURE_ACTION

#define MALLOC_FAILURE_ACTION   errno = ENOMEM;

Definition at line 669 of file dlmalloc.h.

◆ MALLOC_INSPECT_ALL

#define MALLOC_INSPECT_ALL   0

Definition at line 652 of file dlmalloc.h.

◆ MAX_RELEASE_CHECK_RATE

#define MAX_RELEASE_CHECK_RATE   4095

Definition at line 730 of file dlmalloc.h.

◆ MAX_SIZE_T

#define MAX_SIZE_T   (~(size_t)0)

Definition at line 600 of file dlmalloc.h.

◆ MMAP_CLEARS

#define MMAP_CLEARS   1

Definition at line 658 of file dlmalloc.h.

◆ MORECORE_CONTIGUOUS

#define MORECORE_CONTIGUOUS   0

Definition at line 679 of file dlmalloc.h.

◆ MSPACES

#define MSPACES   1

Definition at line 627 of file dlmalloc.h.

◆ NO_MALLINFO

#define NO_MALLINFO   0

Definition at line 742 of file dlmalloc.h.

◆ NO_MALLOC_STATS

#define NO_MALLOC_STATS   0

Definition at line 748 of file dlmalloc.h.

◆ NO_SEGMENT_TRAVERSAL

#define NO_SEGMENT_TRAVERSAL   0

Definition at line 751 of file dlmalloc.h.

◆ NOINLINE

#define NOINLINE

Definition at line 833 of file dlmalloc.h.

◆ ONLY_MSPACES

#define ONLY_MSPACES   1

Definition at line 535 of file dlmalloc.h.

◆ PROCEED_ON_ERROR

#define PROCEED_ON_ERROR   0

Definition at line 645 of file dlmalloc.h.

◆ STRUCT_MALLINFO_DECLARED

#define STRUCT_MALLINFO_DECLARED   1

Definition at line 798 of file dlmalloc.h.

◆ USE_BUILTIN_FFS

#define USE_BUILTIN_FFS   0

Definition at line 736 of file dlmalloc.h.

◆ USE_DEV_RANDOM

#define USE_DEV_RANDOM   0

Definition at line 739 of file dlmalloc.h.

◆ USE_LOCKS

#define USE_LOCKS   1

Definition at line 533 of file dlmalloc.h.

Typedef Documentation

◆ mspace

typedef void* mspace

Definition at line 1306 of file dlmalloc.h.

Function Documentation

◆ create_mspace()

DLMALLOC_EXPORT mspace create_mspace ( size_t  capacity,
int  locked 
)
+ Here is the caller graph for this function:

◆ create_mspace_with_base()

DLMALLOC_EXPORT mspace create_mspace_with_base ( void *  base,
size_t  capacity,
int  locked 
)
+ Here is the caller graph for this function:

◆ destroy_mspace()

DLMALLOC_EXPORT size_t destroy_mspace ( mspace  msp)
+ Here is the caller graph for this function:

◆ mheap_get_trace()

DLMALLOC_EXPORT void mheap_get_trace ( uword  offset,
uword  size 
)

Definition at line 67 of file mem_dlmalloc.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mheap_put_trace()

DLMALLOC_EXPORT void mheap_put_trace ( uword  offset,
uword  size 
)

Definition at line 149 of file mem_dlmalloc.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mspace_calloc()

DLMALLOC_EXPORT void* mspace_calloc ( mspace  msp,
size_t  n_elements,
size_t  elem_size 
)
+ Here is the caller graph for this function:

◆ mspace_disable_expand()

DLMALLOC_EXPORT void mspace_disable_expand ( mspace  msp)
+ Here is the caller graph for this function:

◆ mspace_enable_disable_trace()

DLMALLOC_EXPORT int mspace_enable_disable_trace ( mspace  msp,
int  enable 
)
+ Here is the caller graph for this function:

◆ mspace_footprint()

DLMALLOC_EXPORT size_t mspace_footprint ( mspace  msp)
+ Here is the caller graph for this function:

◆ mspace_free()

DLMALLOC_EXPORT void mspace_free ( mspace  msp,
void *  mem 
)
+ Here is the caller graph for this function:

◆ mspace_get_address_and_size()

DLMALLOC_EXPORT void mspace_get_address_and_size ( mspace  msp,
char **  addrp,
size_t *  sizep 
)
+ Here is the caller graph for this function:

◆ mspace_get_aligned()

DLMALLOC_EXPORT void* mspace_get_aligned ( mspace  msp,
unsigned long  n_user_data_bytes,
unsigned long  align,
unsigned long  align_offset 
)
+ Here is the caller graph for this function:

◆ mspace_independent_calloc()

DLMALLOC_EXPORT void** mspace_independent_calloc ( mspace  msp,
size_t  n_elements,
size_t  elem_size,
void *  chunks[] 
)
+ Here is the caller graph for this function:

◆ mspace_independent_comalloc()

DLMALLOC_EXPORT void** mspace_independent_comalloc ( mspace  msp,
size_t  n_elements,
size_t  sizes[],
void *  chunks[] 
)
+ Here is the caller graph for this function:

◆ mspace_is_heap_object()

DLMALLOC_EXPORT int mspace_is_heap_object ( mspace  msp,
void *  p 
)
+ Here is the caller graph for this function:

◆ mspace_is_traced()

DLMALLOC_EXPORT int mspace_is_traced ( mspace  msp)
+ Here is the caller graph for this function:

◆ mspace_least_addr()

DLMALLOC_EXPORT void* mspace_least_addr ( mspace  msp)
+ Here is the caller graph for this function:

◆ mspace_mallinfo()

DLMALLOC_EXPORT struct dlmallinfo mspace_mallinfo ( mspace  msp)
+ Here is the caller graph for this function:

◆ mspace_malloc()

DLMALLOC_EXPORT void* mspace_malloc ( mspace  msp,
size_t  bytes 
)
+ Here is the caller graph for this function:

◆ mspace_malloc_stats()

DLMALLOC_EXPORT void mspace_malloc_stats ( mspace  msp)
+ Here is the caller graph for this function:

◆ mspace_mallopt()

DLMALLOC_EXPORT int mspace_mallopt ( int  ,
int   
)
+ Here is the caller graph for this function:

◆ mspace_max_footprint()

DLMALLOC_EXPORT size_t mspace_max_footprint ( mspace  msp)
+ Here is the caller graph for this function:

◆ mspace_memalign()

DLMALLOC_EXPORT void* mspace_memalign ( mspace  msp,
size_t  alignment,
size_t  bytes 
)
+ Here is the caller graph for this function:

◆ mspace_put()

DLMALLOC_EXPORT void mspace_put ( mspace  msp,
void *  p 
)
+ Here is the caller graph for this function:

◆ mspace_put_no_offset()

DLMALLOC_EXPORT void mspace_put_no_offset ( mspace  msp,
void *  p 
)
+ Here is the caller graph for this function:

◆ mspace_realloc()

DLMALLOC_EXPORT void* mspace_realloc ( mspace  msp,
void *  mem,
size_t  newsize 
)
+ Here is the caller graph for this function:

◆ mspace_track_large_chunks()

DLMALLOC_EXPORT int mspace_track_large_chunks ( mspace  msp,
int  enable 
)
+ Here is the caller graph for this function:

◆ mspace_trim()

DLMALLOC_EXPORT int mspace_trim ( mspace  msp,
size_t  pad 
)
+ Here is the caller graph for this function:

◆ mspace_usable_size()

DLMALLOC_EXPORT size_t mspace_usable_size ( const void *  mem)
+ Here is the caller graph for this function:

◆ mspace_usable_size_with_delta()

DLMALLOC_EXPORT size_t mspace_usable_size_with_delta ( const void *  p)
+ Here is the caller graph for this function: