Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   mallopt    ( 3 )

установить параметры выделения памяти (set memory allocation parameters)

  Name  |  Synopsis  |  Description  |  Return value  |  Error  |  Conforming to  |    Bugs    |  Examples  |  See also  |

Ошибки (баги) (Bugs)

Specifying an invalid value for param does not generate an error.

A calculation error within the glibc implementation means that a call of the form:

mallopt(M_MXFAST, n)

does not result in fastbins being employed for all allocations of size up to n. To ensure desired results, n should be rounded up to the next multiple greater than or equal to (2k+1)*sizeof(size_t), where k is an integer.

If mallopt() is used to set M_PERTURB, then, as expected, the bytes of allocated memory are initialized to the complement of the byte in value, and when that memory is freed, the bytes of the region are initialized to the byte specified in value. However, there is an off-by-sizeof(size_t) error in the implementation: instead of initializing precisely the block of memory being freed by the call free(p), the block starting at p+sizeof(size_t) is initialized.