mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-26 03:09:07 +08:00
remove internal reallocarray()
... as it's covered by libbpf_reallocarray() since commit dc70da9c70.
This commit is contained in:
committed by
Andrii Nakryiko
parent
ff797cc905
commit
5a10cd2060
@@ -1,20 +0,0 @@
|
||||
// SPDX-License-Identifier: (LGPL-2.0+ OR BSD-2-Clause)
|
||||
/* Copyright (C) 2018 Netronome Systems, Inc. */
|
||||
|
||||
#ifndef __TOOLS_LIBC_COMPAT_H
|
||||
#define __TOOLS_LIBC_COMPAT_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <linux/overflow.h>
|
||||
|
||||
#ifdef COMPAT_NEED_REALLOCARRAY
|
||||
static inline void *reallocarray(void *ptr, size_t nmemb, size_t size)
|
||||
{
|
||||
size_t bytes;
|
||||
|
||||
if (unlikely(check_mul_overflow(nmemb, size, &bytes)))
|
||||
return NULL;
|
||||
return realloc(ptr, bytes);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user