pub unsafe extern "C" fn dlmallopt(
parameter_number: i32,
parameter_value: i32,
) -> i32Expand description
mallopt(int parameter_number, int parameter_value)
Sets tunable parameters The format is to provide a (parameter-number, parameter-value) pair. mallopt then sets the corresponding parameter to the argument value if it can (i.e., so long as the value is meaningful), and returns 1 if successful else 0. To workaround the fact that mallopt is specified to use int, not size_t parameters, the value -1 is specially treated as the maximum unsigned size_t value.
SVID/XPG/ANSI defines four standard param numbers for mallopt, normally defined in malloc.h. None of these are use in this malloc, so setting them has no effect. But this malloc also supports other options in mallopt. See below for details. Briefly, supported parameters are as follows (listed defaults are for “typical” configurations).
| Symbol | param # | default | allowed param values |
|---|---|---|---|
| M_TRIM_THRESHOLD | -1 | 2x1024x1024 | any (-1 disables) |
| M_GRANULARITY | -2 | page size | any power of 2 >= page size |
| M_MMAP_THRESHOLD | -3 | 2x1024x1024 | any (or 0 if no MMAP support) |