version 1.1, 2012/02/21 22:57:48
|
version 1.1.1.3, 2021/03/17 13:38:46
|
Line 13
|
Line 13
|
GNU General Public License for more details. |
GNU General Public License for more details. |
|
|
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. */ | along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
|
|
#ifndef _XALLOC_H |
#ifndef _XALLOC_H |
#define _XALLOC_H |
#define _XALLOC_H |
Line 84 extern void xalloc_die (void)
|
Line 84 extern void xalloc_die (void)
|
known at compile-time. */ |
known at compile-time. */ |
# define XNMALLOC(N,T) \ |
# define XNMALLOC(N,T) \ |
((T *) (sizeof (T) == 1 \ |
((T *) (sizeof (T) == 1 \ |
? xmalloc (N) \ | ? xmalloc (N) \ |
: xnboundedmalloc(N, (size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / sizeof (T), sizeof (T)))) | : xnboundedmalloc(N, (size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / sizeof (T), sizeof (T)))) |
static inline void * |
static inline void * |
xnboundedmalloc (size_t n, size_t bound, size_t s) |
xnboundedmalloc (size_t n, size_t bound, size_t s) |
{ |
{ |