reallocarray introduction available on glibc 2.26. allocates an array of m*n elements but checking for overflow.

This commit is contained in:
David Carlier
2023-03-26 08:33:30 +01:00
parent ae745427cd
commit 3fe37e36fa
3 changed files with 34 additions and 0 deletions
@@ -7,6 +7,8 @@ calloc (overflowing): pointer: (nil), error value: 12 = Out of memory
realloc (size 0): (OK)
realloc: pointer: (not NULL), error value: 0 = Success
realloc (SIZE_MAX): pointer: (nil), error value: 12 = Out of memory
reallocarray: pointer: (not NULL), error value: 0 = Success
reallocarray (SIZE_MAX): pointer: (nil), error value: 12 = Out of memory
memalign (size 0): (OK)
memalign: pointer: (alignment OK), error value: 0 = Success
memalign (SIZE_MAX): pointer: (nil), error value: 12 = Out of memory