Loading...
Searching...
No Matches
Miscellaneous Functions
libavutil » Memory Management

Other functions related to memory allocation. More...

## Functions

int | av_size_mult (size_t a, size_t b, size_t *r)
| Multiply two size_t values checking for overflow.
void | av_max_alloc (size_t max)
| Set the maximum size that may be allocated in one block.

## Detailed Description

Other functions related to memory allocation.

## Function Documentation

## av_size_mult()

int av_size_mult | ( | size_t | a,
|  | size_t | b,
|  | size_t * | r )

Multiply two size_t values checking for overflow.

Parameters

  [in] | a | Operand of multiplication
  [in] | b | Operand of multiplication
  [out] | r | Pointer to the result of the operation

Returns
  0 on success, AVERROR(EINVAL) on overflow

Referenced by av_size_mult().

## av_max_alloc()

void av_max_alloc | ( | size_t | max | ) |

Set the maximum size that may be allocated in one block.

The value specified with this function is effective for all libavutil's heap management functions.

By default, the max value is defined as INT_MAX.

Parameters

  max | Value to be set as the new maximum size

Warning
  Exercise extreme caution when using this function. Don't touch this if you do not understand the full consequence of doing so.

Referenced by av_max_alloc().