alloc-util: reallocarray() exists since glibc-2.26

This commit is contained in:
Yu Watanabe
2025-03-01 00:15:56 +09:00
parent 2e22dd218a
commit e79d88320a
2 changed files with 0 additions and 10 deletions

View File

@@ -119,15 +119,6 @@ _malloc_ _alloc_(1, 2) static inline void *malloc_multiply(size_t need, size_t s
return malloc(size * need ?: 1);
}
#if !HAVE_REALLOCARRAY
_alloc_(2, 3) static inline void *reallocarray(void *p, size_t need, size_t size) {
if (size_multiply_overflow(size, need))
return NULL;
return realloc(p, size * need ?: 1);
}
#endif
_alloc_(2, 3) static inline void *memdup_multiply(const void *p, size_t need, size_t size) {
if (size_multiply_overflow(size, need))
return NULL;