1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-13 00:58:27 +03:00

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

@ -615,7 +615,6 @@ foreach ident : [
#include <keyutils.h>'''],
['bpf', '''#include <sys/syscall.h>
#include <unistd.h>'''],
['reallocarray', '''#include <stdlib.h>'''],
['set_mempolicy', '''#include <stdlib.h>
#include <unistd.h>'''],
['get_mempolicy', '''#include <stdlib.h>

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;