Rizin
unix-like reverse engineering framework and cli tools
jemalloc.h File Reference
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include <limits.h>
#include <strings.h>

Go to the source code of this file.

Classes

struct  chunk_hooks_t
 

Macros

#define JEMALLOC_HAVE_ATTR
 
#define JEMALLOC_HAVE_ATTR_ALLOC_SIZE
 
#define JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF
 
#define JEMALLOC_HAVE_ATTR_FORMAT_PRINTF
 
#define JEMALLOC_OVERRIDE_MEMALIGN
 
#define JEMALLOC_OVERRIDE_VALLOC
 
#define JEMALLOC_USABLE_SIZE_CONST
 
#define JEMALLOC_USE_CXX_THROW
 
#define LG_SIZEOF_PTR   3
 
#define je_malloc_conf   malloc_conf
 
#define je_malloc_message   malloc_message
 
#define je_malloc   malloc
 
#define je_calloc   calloc
 
#define je_posix_memalign   posix_memalign
 
#define je_aligned_alloc   aligned_alloc
 
#define je_realloc   realloc
 
#define je_free   free
 
#define je_mallocx   mallocx
 
#define je_rallocx   rallocx
 
#define je_xallocx   xallocx
 
#define je_sallocx   sallocx
 
#define je_dallocx   dallocx
 
#define je_sdallocx   sdallocx
 
#define je_nallocx   nallocx
 
#define je_mallctl   mallctl
 
#define je_mallctlnametomib   mallctlnametomib
 
#define je_mallctlbymib   mallctlbymib
 
#define je_malloc_stats_print   malloc_stats_print
 
#define je_memalign   memalign
 
#define je_valloc   valloc
 
#define JEMALLOC_VERSION   "4.5.0-0-g04380e79f1e2428bd0ad000bbc6e3d2dfc6b66a5"
 
#define JEMALLOC_VERSION_MAJOR   4
 
#define JEMALLOC_VERSION_MINOR   5
 
#define JEMALLOC_VERSION_BUGFIX   0
 
#define JEMALLOC_VERSION_NREV   0
 
#define JEMALLOC_VERSION_GID   "04380e79f1e2428bd0ad000bbc6e3d2dfc6b66a5"
 
#define MALLOCX_LG_ALIGN(la)   ((int)(la))
 
#define MALLOCX_ALIGN(a)
 
#define MALLOCX_ZERO   ((int)0x40)
 
#define MALLOCX_TCACHE(tc)   ((int)(((tc)+2) << 8))
 
#define MALLOCX_TCACHE_NONE   MALLOCX_TCACHE(-1)
 
#define MALLOCX_ARENA(a)   ((((int)(a))+1) << 20)
 
#define JEMALLOC_CXX_THROW
 
#define JEMALLOC_ATTR(s)   __attribute__((s))
 
#define JEMALLOC_ALIGNED(s)   JEMALLOC_ATTR(aligned(s))
 
#define JEMALLOC_ALLOC_SIZE(s)
 
#define JEMALLOC_ALLOC_SIZE2(s1, s2)
 
#define JEMALLOC_EXPORT   JEMALLOC_ATTR(visibility("default"))
 
#define JEMALLOC_FORMAT_PRINTF(s, i)   JEMALLOC_ATTR(format(gnu_printf, s, i))
 
#define JEMALLOC_NOINLINE   JEMALLOC_ATTR(noinline)
 
#define JEMALLOC_NOTHROW   JEMALLOC_ATTR(nothrow)
 
#define JEMALLOC_SECTION(s)   JEMALLOC_ATTR(section(s))
 
#define JEMALLOC_RESTRICT_RETURN
 
#define JEMALLOC_ALLOCATOR
 

Typedefs

typedef void *() chunk_alloc_t(void *, size_t, size_t, bool *, bool *, unsigned)
 
typedef bool() chunk_dalloc_t(void *, size_t, bool, unsigned)
 
typedef bool() chunk_commit_t(void *, size_t, size_t, size_t, unsigned)
 
typedef bool() chunk_decommit_t(void *, size_t, size_t, size_t, unsigned)
 
typedef bool() chunk_purge_t(void *, size_t, size_t, size_t, unsigned)
 
typedef bool() chunk_split_t(void *, size_t, size_t, size_t, bool, unsigned)
 
typedef bool() chunk_merge_t(void *, size_t, void *, size_t, bool, unsigned)
 

Functions

JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN void JEMALLOC_NOTHROWje_malloc (size_t size) JEMALLOC_CXX_THROW JEMALLOC_ATTR(malloc) JEMALLOC_ALLOC_SIZE(1)
 
JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN void JEMALLOC_NOTHROWje_calloc (size_t num, size_t size) JEMALLOC_CXX_THROW JEMALLOC_ATTR(malloc) JEMALLOC_ALLOC_SIZE2(1
 
JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN void JEMALLOC_NOTHROW JEMALLOC_EXPORT int JEMALLOC_NOTHROW je_posix_memalign (void **memptr, size_t alignment, size_t size) JEMALLOC_CXX_THROW JEMALLOC_ATTR(nonnull(1))
 
JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN void JEMALLOC_NOTHROWje_aligned_alloc (size_t alignment, size_t size) JEMALLOC_CXX_THROW JEMALLOC_ATTR(malloc) JEMALLOC_ALLOC_SIZE(2)
 
JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN void JEMALLOC_NOTHROWje_realloc (void *ptr, size_t size) JEMALLOC_CXX_THROW JEMALLOC_ALLOC_SIZE(2)
 
JEMALLOC_EXPORT void JEMALLOC_NOTHROW je_free (void *ptr) JEMALLOC_CXX_THROW
 
JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN void JEMALLOC_NOTHROWje_mallocx (size_t size, int flags) JEMALLOC_ATTR(malloc) JEMALLOC_ALLOC_SIZE(1)
 
JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN void JEMALLOC_NOTHROWje_rallocx (void *ptr, size_t size, int flags) JEMALLOC_ALLOC_SIZE(2)
 
JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_xallocx (void *ptr, size_t size, size_t extra, int flags)
 
JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_sallocx (const void *ptr, int flags) JEMALLOC_ATTR(pure)
 
JEMALLOC_EXPORT void JEMALLOC_NOTHROW je_dallocx (void *ptr, int flags)
 
JEMALLOC_EXPORT void JEMALLOC_NOTHROW je_sdallocx (void *ptr, size_t size, int flags)
 
JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_nallocx (size_t size, int flags) JEMALLOC_ATTR(pure)
 
JEMALLOC_EXPORT int JEMALLOC_NOTHROW je_mallctl (const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen)
 
JEMALLOC_EXPORT int JEMALLOC_NOTHROW je_mallctlnametomib (const char *name, size_t *mibp, size_t *miblenp)
 
JEMALLOC_EXPORT int JEMALLOC_NOTHROW je_mallctlbymib (const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, void *newp, size_t newlen)
 
JEMALLOC_EXPORT void JEMALLOC_NOTHROW je_malloc_stats_print (void(*write_cb)(void *, const char *), void *je_cbopaque, const char *opts)
 
JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_malloc_usable_size (JEMALLOC_USABLE_SIZE_CONST void *ptr) JEMALLOC_CXX_THROW
 
JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN void JEMALLOC_NOTHROWje_memalign (size_t alignment, size_t size) JEMALLOC_CXX_THROW JEMALLOC_ATTR(malloc)
 
JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN void JEMALLOC_NOTHROWje_valloc (size_t size) JEMALLOC_CXX_THROW JEMALLOC_ATTR(malloc)
 

Variables

JEMALLOC_EXPORT const char * je_malloc_conf
 
JEMALLOC_EXPORT void(* je_malloc_message )(void *cbopaque, const char *s)
 

Macro Definition Documentation

◆ je_aligned_alloc

#define je_aligned_alloc   aligned_alloc

Definition at line 64 of file jemalloc.h.

◆ je_calloc

#define je_calloc   calloc

Definition at line 62 of file jemalloc.h.

◆ je_dallocx

#define je_dallocx   dallocx

Definition at line 71 of file jemalloc.h.

◆ je_free

#define je_free   free

Definition at line 66 of file jemalloc.h.

◆ je_mallctl

#define je_mallctl   mallctl

Definition at line 74 of file jemalloc.h.

◆ je_mallctlbymib

#define je_mallctlbymib   mallctlbymib

Definition at line 76 of file jemalloc.h.

◆ je_mallctlnametomib

#define je_mallctlnametomib   mallctlnametomib

Definition at line 75 of file jemalloc.h.

◆ je_malloc

#define je_malloc   malloc

Definition at line 61 of file jemalloc.h.

◆ je_malloc_conf

#define je_malloc_conf   malloc_conf

Definition at line 59 of file jemalloc.h.

◆ je_malloc_message

#define je_malloc_message   malloc_message

Definition at line 60 of file jemalloc.h.

◆ je_malloc_stats_print

#define je_malloc_stats_print   malloc_stats_print

Definition at line 77 of file jemalloc.h.

◆ je_mallocx

#define je_mallocx   mallocx

Definition at line 67 of file jemalloc.h.

◆ je_memalign

#define je_memalign   memalign

Definition at line 79 of file jemalloc.h.

◆ je_nallocx

#define je_nallocx   nallocx

Definition at line 73 of file jemalloc.h.

◆ je_posix_memalign

#define je_posix_memalign   posix_memalign

Definition at line 63 of file jemalloc.h.

◆ je_rallocx

#define je_rallocx   rallocx

Definition at line 68 of file jemalloc.h.

◆ je_realloc

#define je_realloc   realloc

Definition at line 65 of file jemalloc.h.

◆ je_sallocx

#define je_sallocx   sallocx

Definition at line 70 of file jemalloc.h.

◆ je_sdallocx

#define je_sdallocx   sdallocx

Definition at line 72 of file jemalloc.h.

◆ je_valloc

#define je_valloc   valloc

Definition at line 80 of file jemalloc.h.

◆ je_xallocx

#define je_xallocx   xallocx

Definition at line 69 of file jemalloc.h.

◆ JEMALLOC_ALIGNED

#define JEMALLOC_ALIGNED (   s)    JEMALLOC_ATTR(aligned(s))

Definition at line 150 of file jemalloc.h.

◆ JEMALLOC_ALLOC_SIZE

#define JEMALLOC_ALLOC_SIZE (   s)

Definition at line 156 of file jemalloc.h.

◆ JEMALLOC_ALLOC_SIZE2

#define JEMALLOC_ALLOC_SIZE2 (   s1,
  s2 
)

Definition at line 157 of file jemalloc.h.

◆ JEMALLOC_ALLOCATOR

#define JEMALLOC_ALLOCATOR

Definition at line 173 of file jemalloc.h.

◆ JEMALLOC_ATTR

#define JEMALLOC_ATTR (   s)    __attribute__((s))

Definition at line 149 of file jemalloc.h.

◆ JEMALLOC_CXX_THROW

#define JEMALLOC_CXX_THROW

Definition at line 119 of file jemalloc.h.

◆ JEMALLOC_EXPORT

#define JEMALLOC_EXPORT   JEMALLOC_ATTR(visibility("default"))

Definition at line 160 of file jemalloc.h.

◆ JEMALLOC_FORMAT_PRINTF

#define JEMALLOC_FORMAT_PRINTF (   s,
  i 
)    JEMALLOC_ATTR(format(gnu_printf, s, i))

Definition at line 163 of file jemalloc.h.

◆ JEMALLOC_HAVE_ATTR

#define JEMALLOC_HAVE_ATTR

Definition at line 8 of file jemalloc.h.

◆ JEMALLOC_HAVE_ATTR_ALLOC_SIZE

#define JEMALLOC_HAVE_ATTR_ALLOC_SIZE

Definition at line 11 of file jemalloc.h.

◆ JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF

#define JEMALLOC_HAVE_ATTR_FORMAT_GNU_PRINTF

Definition at line 14 of file jemalloc.h.

◆ JEMALLOC_HAVE_ATTR_FORMAT_PRINTF

#define JEMALLOC_HAVE_ATTR_FORMAT_PRINTF

Definition at line 17 of file jemalloc.h.

◆ JEMALLOC_NOINLINE

#define JEMALLOC_NOINLINE   JEMALLOC_ATTR(noinline)

Definition at line 169 of file jemalloc.h.

◆ JEMALLOC_NOTHROW

#define JEMALLOC_NOTHROW   JEMALLOC_ATTR(nothrow)

Definition at line 170 of file jemalloc.h.

◆ JEMALLOC_OVERRIDE_MEMALIGN

#define JEMALLOC_OVERRIDE_MEMALIGN

Definition at line 23 of file jemalloc.h.

◆ JEMALLOC_OVERRIDE_VALLOC

#define JEMALLOC_OVERRIDE_VALLOC

Definition at line 24 of file jemalloc.h.

◆ JEMALLOC_RESTRICT_RETURN

#define JEMALLOC_RESTRICT_RETURN

Definition at line 172 of file jemalloc.h.

◆ JEMALLOC_SECTION

#define JEMALLOC_SECTION (   s)    JEMALLOC_ATTR(section(s))

Definition at line 171 of file jemalloc.h.

◆ JEMALLOC_USABLE_SIZE_CONST

#define JEMALLOC_USABLE_SIZE_CONST

Definition at line 33 of file jemalloc.h.

◆ JEMALLOC_USE_CXX_THROW

#define JEMALLOC_USE_CXX_THROW

Definition at line 40 of file jemalloc.h.

◆ JEMALLOC_VERSION

#define JEMALLOC_VERSION   "4.5.0-0-g04380e79f1e2428bd0ad000bbc6e3d2dfc6b66a5"

Definition at line 89 of file jemalloc.h.

◆ JEMALLOC_VERSION_BUGFIX

#define JEMALLOC_VERSION_BUGFIX   0

Definition at line 92 of file jemalloc.h.

◆ JEMALLOC_VERSION_GID

#define JEMALLOC_VERSION_GID   "04380e79f1e2428bd0ad000bbc6e3d2dfc6b66a5"

Definition at line 94 of file jemalloc.h.

◆ JEMALLOC_VERSION_MAJOR

#define JEMALLOC_VERSION_MAJOR   4

Definition at line 90 of file jemalloc.h.

◆ JEMALLOC_VERSION_MINOR

#define JEMALLOC_VERSION_MINOR   5

Definition at line 91 of file jemalloc.h.

◆ JEMALLOC_VERSION_NREV

#define JEMALLOC_VERSION_NREV   0

Definition at line 93 of file jemalloc.h.

◆ LG_SIZEOF_PTR

#define LG_SIZEOF_PTR   3

Definition at line 51 of file jemalloc.h.

◆ MALLOCX_ALIGN

#define MALLOCX_ALIGN (   a)
Value:
((int)(((size_t)(a) < (size_t)INT_MAX) ? ffs((int)(a))-1 : \
ffs((int)(((size_t)(a))>>32))+31))
#define INT_MAX
Definition: cp-demangle.c:131
static int
Definition: sfsocketcall.h:114
#define a(i)
Definition: sha256.c:41

Definition at line 100 of file jemalloc.h.

◆ MALLOCX_ARENA

#define MALLOCX_ARENA (   a)    ((((int)(a))+1) << 20)

Definition at line 114 of file jemalloc.h.

◆ MALLOCX_LG_ALIGN

#define MALLOCX_LG_ALIGN (   la)    ((int)(la))

Definition at line 96 of file jemalloc.h.

◆ MALLOCX_TCACHE

#define MALLOCX_TCACHE (   tc)    ((int)(((tc)+2) << 8))

Definition at line 109 of file jemalloc.h.

◆ MALLOCX_TCACHE_NONE

#define MALLOCX_TCACHE_NONE   MALLOCX_TCACHE(-1)

Definition at line 110 of file jemalloc.h.

◆ MALLOCX_ZERO

#define MALLOCX_ZERO   ((int)0x40)

Definition at line 104 of file jemalloc.h.

Typedef Documentation

◆ chunk_alloc_t

typedef void*() chunk_alloc_t(void *, size_t, size_t, bool *, bool *, unsigned)

Definition at line 260 of file jemalloc.h.

◆ chunk_commit_t

typedef bool() chunk_commit_t(void *, size_t, size_t, size_t, unsigned)

Definition at line 273 of file jemalloc.h.

◆ chunk_dalloc_t

typedef bool() chunk_dalloc_t(void *, size_t, bool, unsigned)

Definition at line 266 of file jemalloc.h.

◆ chunk_decommit_t

typedef bool() chunk_decommit_t(void *, size_t, size_t, size_t, unsigned)

Definition at line 280 of file jemalloc.h.

◆ chunk_merge_t

typedef bool() chunk_merge_t(void *, size_t, void *, size_t, bool, unsigned)

Definition at line 301 of file jemalloc.h.

◆ chunk_purge_t

typedef bool() chunk_purge_t(void *, size_t, size_t, size_t, unsigned)

Definition at line 287 of file jemalloc.h.

◆ chunk_split_t

typedef bool() chunk_split_t(void *, size_t, size_t, size_t, bool, unsigned)

Definition at line 294 of file jemalloc.h.

Function Documentation

◆ je_aligned_alloc()

◆ je_calloc()

◆ je_dallocx()

JEMALLOC_EXPORT void JEMALLOC_NOTHROW je_dallocx ( void *  ptr,
int  flags 
)

◆ je_free()

JEMALLOC_EXPORT void JEMALLOC_NOTHROW je_free ( void *  ptr)

◆ je_mallctl()

JEMALLOC_EXPORT int JEMALLOC_NOTHROW je_mallctl ( const char *  name,
void *  oldp,
size_t oldlenp,
void *  newp,
size_t  newlen 
)

◆ je_mallctlbymib()

JEMALLOC_EXPORT int JEMALLOC_NOTHROW je_mallctlbymib ( const size_t mib,
size_t  miblen,
void *  oldp,
size_t oldlenp,
void *  newp,
size_t  newlen 
)

◆ je_mallctlnametomib()

JEMALLOC_EXPORT int JEMALLOC_NOTHROW je_mallctlnametomib ( const char *  name,
size_t mibp,
size_t miblenp 
)

◆ je_malloc()

◆ je_malloc_stats_print()

JEMALLOC_EXPORT void JEMALLOC_NOTHROW je_malloc_stats_print ( void(*)(void *, const char *)  write_cb,
void *  je_cbopaque,
const char *  opts 
)

◆ je_malloc_usable_size()

JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_malloc_usable_size ( JEMALLOC_USABLE_SIZE_CONST void *  ptr)

◆ je_mallocx()

◆ je_memalign()

◆ je_nallocx()

JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_nallocx ( size_t  size,
int  flags 
)

◆ je_posix_memalign()

◆ je_rallocx()

JEMALLOC_EXPORT JEMALLOC_ALLOCATOR JEMALLOC_RESTRICT_RETURN void JEMALLOC_NOTHROW* je_rallocx ( void *  ptr,
size_t  size,
int  flags 
)

◆ je_realloc()

◆ je_sallocx()

JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_sallocx ( const void *  ptr,
int  flags 
)

◆ je_sdallocx()

JEMALLOC_EXPORT void JEMALLOC_NOTHROW je_sdallocx ( void *  ptr,
size_t  size,
int  flags 
)

◆ je_valloc()

◆ je_xallocx()

JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_xallocx ( void *  ptr,
size_t  size,
size_t  extra,
int  flags 
)

Variable Documentation

◆ je_malloc_conf

JEMALLOC_EXPORT const char* je_malloc_conf
extern

◆ je_malloc_message

JEMALLOC_EXPORT void(* je_malloc_message) (void *cbopaque, const char *s) ( void *  cbopaque,
const char *  s 
)
extern