World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Miscellaneous Functions

Other functions related to memory allocation. Подробнее...

+ Граф связей класса Miscellaneous Functions:

Функции

static int av_size_mult (size_t a, size_t b, size_t *r)
 
void av_max_alloc (size_t max)
 

Подробное описание

Other functions related to memory allocation.

Функции

◆ av_size_mult()

static int av_size_mult ( size_t  a,
size_t  b,
size_t r 
)
inlinestatic

#include <C:/git/world-of-might-and-magic/lib/win32/x86/ffmpeg-4.2.2/include/libavutil/mem.h>

Multiply two size_t values checking for overflow.

Аргументы
[in]a,bOperands of multiplication
[out]rPointer to the result of the operation
Возвращает
0 on success, AVERROR(EINVAL) on overflow

См. определение в файле mem.h строка 669

670 {
671  size_t t = a * b;
672  /* Hack inspired from glibc: don't try the division if nelem and elsize
673  * are both less than sqrt(SIZE_MAX). */
674  if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b)
675  return AVERROR(EINVAL);
676  *r = t;
677  return 0;
678 }

◆ av_max_alloc()

void av_max_alloc ( size_t  max)

#include <C:/git/world-of-might-and-magic/lib/win32/x86/ffmpeg-4.2.2/include/libavutil/mem.h>

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.

Аргументы
maxValue to be set as the new maximum size
Предупреждения
Exercise extreme caution when using this function. Don't touch this if you do not understand the full consequence of doing so.
t
GLdouble GLdouble t
Definition: SDL_opengl.h:2071
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1112
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1112