master-server/deps/libtommath/s_mp_warray_get.c

19 lines
463 B
C
Raw Normal View History

2024-05-15 15:20:32 -04:00
#include "tommath_private.h"
#ifdef S_MP_WARRAY_GET_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
/* SPDX-License-Identifier: Unlicense */
void *s_mp_warray_get(void)
{
if (s_mp_warray.w_used)
return NULL;
if (s_mp_warray.w_free == NULL) {
s_mp_warray.w_free = MP_CALLOC(MP_WARRAY, sizeof(mp_word));
}
s_mp_warray.w_used = s_mp_warray.w_free;
s_mp_warray.w_free = NULL;
return s_mp_warray.w_used;
}
#endif