X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/4934f93dfb30c93a1636e3227584e791cd062bfb..refs/heads/master:/deps/jemalloc/doc/jemalloc.html?ds=inline diff --git a/deps/jemalloc/doc/jemalloc.html b/deps/jemalloc/doc/jemalloc.html index 415e298d..002356e5 100644 --- a/deps/jemalloc/doc/jemalloc.html +++ b/deps/jemalloc/doc/jemalloc.html @@ -1,8 +1,8 @@ -JEMALLOC

Name

jemalloc — general purpose memory allocation functions

LIBRARY

This manual describes jemalloc 3.0.0-0-gfc9b1dbf69f59d7ecfc4ac68da9847e017e1d046. More information +JEMALLOC

Name

jemalloc — general purpose memory allocation functions

LIBRARY

This manual describes jemalloc 3.2.0-0-g87499f6748ebe4817571e817e9f680ccb5bf54a9. More information can be found at the jemalloc website.

SYNOPSIS

#include <stdlib.h>
-#include <jemalloc/jemalloc.h>

Standard API

void *malloc(size_t size);
 
void *calloc(size_t number,
 size_t size);
 
int posix_memalign(void **ptr,
 size_t alignment,
 size_t size);
 
void *aligned_alloc(size_t alignment,
 size_t size);
 
void *realloc(void *ptr,
 size_t size);
 
void free(void *ptr);
 

Non-standard API

size_t malloc_usable_size(const void *ptr);
 
void malloc_stats_print(void (*write_cb) +#include <jemalloc/jemalloc.h>

Standard API

void *malloc(size_t size);
 
void *calloc(size_t number,
 size_t size);
 
int posix_memalign(void **ptr,
 size_t alignment,
 size_t size);
 
void *aligned_alloc(size_t alignment,
 size_t size);
 
void *realloc(void *ptr,
 size_t size);
 
void free(void *ptr);
 

Non-standard API

size_t malloc_usable_size(const void *ptr);
 
void malloc_stats_print(void (*write_cb) (void *, const char *) - ,
 void *cbopaque,
 const char *opts);
 
int mallctl(const char *name,
 void *oldp,
 size_t *oldlenp,
 void *newp,
 size_t newlen);
 
int mallctlnametomib(const char *name,
 size_t *mibp,
 size_t *miblenp);
 
int mallctlbymib(const size_t *mib,
 size_t miblen,
 void *oldp,
 size_t *oldlenp,
 void *newp,
 size_t newlen);
 
void (*malloc_message)(void *cbopaque,
 const char *s);
 

const char *malloc_conf;

Experimental API

int allocm(void **ptr,
 size_t *rsize,
 size_t size,
 int flags);
 
int rallocm(void **ptr,
 size_t *rsize,
 size_t size,
 size_t extra,
 int flags);
 
int sallocm(const void *ptr,
 size_t *rsize,
 int flags);
 
int dallocm(void *ptr,
 int flags);
 
int nallocm(size_t *rsize,
 size_t size,
 int flags);
 

DESCRIPTION

Standard API

The malloc() function allocates + ,

 void *cbopaque,
 const char *opts);
 
int mallctl(const char *name,
 void *oldp,
 size_t *oldlenp,
 void *newp,
 size_t newlen);
 
int mallctlnametomib(const char *name,
 size_t *mibp,
 size_t *miblenp);
 
int mallctlbymib(const size_t *mib,
 size_t miblen,
 void *oldp,
 size_t *oldlenp,
 void *newp,
 size_t newlen);
 
void (*malloc_message)(void *cbopaque,
 const char *s);
 

const char *malloc_conf;

Experimental API

int allocm(void **ptr,
 size_t *rsize,
 size_t size,
 int flags);
 
int rallocm(void **ptr,
 size_t *rsize,
 size_t size,
 size_t extra,
 int flags);
 
int sallocm(const void *ptr,
 size_t *rsize,
 int flags);
 
int dallocm(void *ptr,
 int flags);
 
int nallocm(size_t *rsize,
 size_t size,
 int flags);
 

DESCRIPTION

Standard API

The malloc() function allocates size bytes of uninitialized memory. The allocated space is suitably aligned (after possible pointer coercion) for storage of any type of object.

The calloc() function allocates @@ -38,7 +38,7 @@ malloc() for the specified size.

The free() function causes the allocated memory referenced by ptr to be made available for future allocations. If ptr is - NULL, no action occurs.

Non-standard API

The malloc_usable_size() function + NULL, no action occurs.

Non-standard API

The malloc_usable_size() function returns the usable size of the allocation pointed to by ptr. The return value may be larger than the size that was requested during allocation. The @@ -118,7 +118,7 @@ for (i = 0; i < nbins; i++) { len = sizeof(bin_size); mallctlbymib(mib, miblen, &bin_size, &len, NULL, 0); /* Do something with bin_size... */ -}

Experimental API

The experimental API is subject to change or removal without regard +}

Experimental API

The experimental API is subject to change or removal without regard for backward compatibility. If --disable-experimental is specified during configuration, the experimental API is omitted.

The allocm(), @@ -146,7 +146,11 @@ for (i = 0; i < nbins; i++) { that are initialized to contain zero bytes. If this option is absent, newly allocated memory is uninitialized.

ALLOCM_NO_MOVE

For reallocation, fail rather than moving the object. This constraint can apply to both growth and - shrinkage.

+ shrinkage.

ALLOCM_ARENA(a) +

Use the arena specified by the index + a. This macro does not validate that + a specifies an arena in the valid + range.

The allocm() function allocates at least size bytes of memory, sets *ptr to the base address of the allocation, and @@ -404,15 +408,24 @@ for (i = 0; i < nbins; i++) { (size_t) r-

Virtual memory chunk size (log base 2). The default - chunk size is 4 MiB (2^22).

+ chunk size is 4 MiB (2^22).

+ + "opt.dss" + + (const char *) + r- +

dss (sbrk(2)) allocation precedence as + related to mmap(2) allocation. The following + settings are supported: “disabled”, “primary”, + and “secondary” (default).

"opt.narenas" (size_t) r- -

Maximum number of arenas to use. The default maximum - number of arenas is four times the number of CPUs, or one if there is a - single CPU.

+

Maximum number of arenas to use for automatic + multiplexing of threads and arenas. The default is four times the + number of CPUs, or one if there is a single CPU.

"opt.lg_dirty_mult" @@ -425,7 +438,7 @@ for (i = 0; i < nbins; i++) { pages via madvise(2) or a similar system call. This provides the kernel with sufficient information to recycle dirty pages if physical memory becomes scarce and the pages remain unused. The - default minimum ratio is 32:1 (2^5:1); an option value of -1 will + default minimum ratio is 8:1 (2^3:1); an option value of -1 will disable dirty page purging.

"opt.stats_print" @@ -454,7 +467,8 @@ for (i = 0; i < nbins; i++) { 0x5a. This is intended for debugging and will impact performance negatively. This option is disabled by default unless --enable-debug is specified during - configuration, in which case it is enabled by default.

+ configuration, in which case it is enabled by default unless running + inside Valgrind.

"opt.quarantine" @@ -470,8 +484,9 @@ for (i = 0; i < nbins; i++) { option is enabled. This feature is of particular use in combination with Valgrind, which can detect attempts to access quarantined objects. This is intended for debugging and will - impact performance negatively. The default quarantine size is - 0.

+ impact performance negatively. The default quarantine size is 0 unless + running inside Valgrind, in which case the default is 16 + MiB.

"opt.redzone" @@ -489,7 +504,7 @@ for (i = 0; i < nbins; i++) { which needs redzones in order to do effective buffer overflow/underflow detection. This option is intended for debugging and will impact performance negatively. This option is disabled by - default.

+ default unless running inside Valgrind.

"opt.zero" @@ -520,21 +535,9 @@ for (i = 0; i < nbins; i++) { r- [--enable-valgrind]

Valgrind - support enabled/disabled. If enabled, several other options are - automatically modified during options processing to work well with - Valgrind: - "opt.junk" - - and - "opt.zero" - are set - to false, - "opt.quarantine" - is - set to 16 MiB, and - "opt.redzone" - is set to - true. This option is disabled by default.

+ support enabled/disabled. This option is vestigal because jemalloc + auto-detects whether it is running inside Valgrind. This option is + disabled by default, unless running inside Valgrind.

"opt.xmalloc" @@ -566,7 +569,7 @@ malloc_conf = "xmalloc:true";

"opt.lg_tcache_max" option for related tuning information. This option is enabled by - default.

+ default unless running inside Valgrind.

"opt.lg_tcache_max" @@ -724,12 +727,8 @@ malloc_conf = "xmalloc:true";

(unsigned) rw

Get or set the arena associated with the calling - thread. The arena index must be less than the maximum number of arenas - (see the - "arenas.narenas" - - mallctl). If the specified arena was not initialized beforehand (see - the + thread. If the specified arena was not initialized beforehand (see the + "arenas.initialized" mallctl), it will be automatically initialized as a side effect of @@ -804,13 +803,38 @@ malloc_conf = "xmalloc:true";

a thread exits. However, garbage collection is triggered by allocation activity, so it is possible for a thread that stops allocating/deallocating to retain its cache indefinitely, in which case - the developer may find manual flushing useful.

+ the developer may find manual flushing useful.

+ + "arena.<i>.purge" + + (unsigned) + -- +

Purge unused dirty pages for arena <i>, or for + all arenas if <i> equals + "arenas.narenas" + . +

+ + "arena.<i>.dss" + + (const char *) + rw +

Set the precedence of dss allocation as related to mmap + allocation for arena <i>, or for all arenas if <i> equals + + "arenas.narenas" + . See + + "opt.dss" + for supported + settings. +

"arenas.narenas" (unsigned) r- -

Maximum number of arenas.

+

Current limit on number of arenas.

"arenas.initialized" @@ -891,7 +915,14 @@ malloc_conf = "xmalloc:true";

(unsigned) -w

Purge unused dirty pages for the specified arena, or - for all arenas if none is specified.

+ for all arenas if none is specified.

+ + "arenas.extend" + + (unsigned) + r- +

Extend the array of arenas by appending a new arena, + and returning the new arena index.

"prof.active" @@ -966,7 +997,11 @@ malloc_conf = "xmalloc:true";

equal to "stats.allocated" . -

+ This does not include + + "stats.arenas.<i>.pdirty" + and pages + entirely devoted to allocator metadata.

"stats.mapped" @@ -1028,6 +1063,16 @@ malloc_conf = "xmalloc:true";

Cumulative number of huge deallocation requests.

+ "stats.arenas.<i>.dss" + + (const char *) + r- +

dss (sbrk(2)) allocation precedence as + related to mmap(2) allocation. See + "opt.dss" + for details. +

+ "stats.arenas.<i>.nthreads" (unsigned) @@ -1039,7 +1084,7 @@ malloc_conf = "xmalloc:true";

(size_t) r- -

Number of pages in active runs.

+

Number of pages in active runs.

"stats.arenas.<i>.pdirty" @@ -1263,11 +1308,7 @@ malloc_conf = "xmalloc:true";

it detects, because the performance impact for storing such information would be prohibitive. However, jemalloc does integrate with the most excellent Valgrind tool if the - --enable-valgrind configuration option is enabled and the - - "opt.valgrind" - option - is enabled.

DIAGNOSTIC MESSAGES

If any of the memory allocation/deallocation functions detect an + --enable-valgrind configuration option is enabled.

DIAGNOSTIC MESSAGES

If any of the memory allocation/deallocation functions detect an error or warning condition, a message will be printed to file descriptor STDERR_FILENO. Errors will result in the process dumping core. If the @@ -1283,7 +1324,7 @@ malloc_conf = "xmalloc:true";

malloc_stats_print(), followed by a string pointer. Please note that doing anything which tries to allocate memory in this function is likely to result in a crash or deadlock.

All messages are prefixed by - “<jemalloc>: ”.

RETURN VALUES

Standard API

The malloc() and + “<jemalloc>: ”.

RETURN VALUES

Standard API

The malloc() and calloc() functions return a pointer to the allocated memory if successful; otherwise a NULL pointer is returned and errno is set to @@ -1311,7 +1352,7 @@ malloc_conf = "xmalloc:true";

allocation failure. The realloc() function always leaves the original buffer intact when an error occurs.

The free() function returns no - value.

Non-standard API

The malloc_usable_size() function + value.

Non-standard API

The malloc_usable_size() function returns the usable size of the allocation pointed to by ptr.

The mallctl(), mallctlnametomib(), and @@ -1330,7 +1371,7 @@ malloc_conf = "xmalloc:true";

occurred.

EFAULT

An interface with side effects failed in some way not directly related to mallctl*() read/write processing.

-

Experimental API

The allocm(), +

Experimental API

The allocm(), rallocm(), sallocm(), dallocm(), and