mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-07 06:43:00 +03:00
tests: use xmalloc to allocate implementation array
The benchmark and tests must fail in case of allocation failure in the implementation array. Also annotate the x* allocators in support.h so that the compiler has more information about them. Reviewed-by: Florian Weimer <fweimer@redhat.com>
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <support/support.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -146,8 +147,8 @@ static impl_t *impl_array;
|
||||
skip = impl; \
|
||||
else \
|
||||
impl_count++; \
|
||||
a = impl_array = malloc ((impl_count + func_count) * \
|
||||
sizeof (impl_t)); \
|
||||
a = impl_array = xmalloc ((impl_count + func_count) * \
|
||||
sizeof (impl_t)); \
|
||||
for (impl = __start_impls; impl < __stop_impls; ++impl) \
|
||||
if (impl != skip) \
|
||||
*a++ = *impl; \
|
||||
|
Reference in New Issue
Block a user