summaryrefslogtreecommitdiffstats
path: root/gl/xmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gl/xmalloc.c')
-rw-r--r--gl/xmalloc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gl/xmalloc.c b/gl/xmalloc.c
index 289cbd05..5befdab7 100644
--- a/gl/xmalloc.c
+++ b/gl/xmalloc.c
@@ -1,6 +1,6 @@
1/* xmalloc.c -- malloc with out of memory checking 1/* xmalloc.c -- malloc with out of memory checking
2 2
3 Copyright (C) 1990-2000, 2002-2006, 2008-2023 Free Software Foundation, Inc. 3 Copyright (C) 1990-2000, 2002-2006, 2008-2024 Free Software Foundation, Inc.
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@
30#include <string.h> 30#include <string.h>
31 31
32static void * _GL_ATTRIBUTE_PURE 32static void * _GL_ATTRIBUTE_PURE
33nonnull (void *p) 33check_nonnull (void *p)
34{ 34{
35 if (!p) 35 if (!p)
36 xalloc_die (); 36 xalloc_die ();
@@ -42,13 +42,13 @@ nonnull (void *p)
42void * 42void *
43xmalloc (size_t s) 43xmalloc (size_t s)
44{ 44{
45 return nonnull (malloc (s)); 45 return check_nonnull (malloc (s));
46} 46}
47 47
48void * 48void *
49ximalloc (idx_t s) 49ximalloc (idx_t s)
50{ 50{
51 return nonnull (imalloc (s)); 51 return check_nonnull (imalloc (s));
52} 52}
53 53
54char * 54char *
@@ -72,7 +72,7 @@ xrealloc (void *p, size_t s)
72void * 72void *
73xirealloc (void *p, idx_t s) 73xirealloc (void *p, idx_t s)
74{ 74{
75 return nonnull (irealloc (p, s)); 75 return check_nonnull (irealloc (p, s));
76} 76}
77 77
78/* Change the size of an allocated block of memory P to an array of N 78/* Change the size of an allocated block of memory P to an array of N
@@ -90,7 +90,7 @@ xreallocarray (void *p, size_t n, size_t s)
90void * 90void *
91xireallocarray (void *p, idx_t n, idx_t s) 91xireallocarray (void *p, idx_t n, idx_t s)
92{ 92{
93 return nonnull (ireallocarray (p, n, s)); 93 return check_nonnull (ireallocarray (p, n, s));
94} 94}
95 95
96/* Allocate an array of N objects, each with S bytes of memory, 96/* Allocate an array of N objects, each with S bytes of memory,
@@ -295,13 +295,13 @@ xizalloc (idx_t s)
295void * 295void *
296xcalloc (size_t n, size_t s) 296xcalloc (size_t n, size_t s)
297{ 297{
298 return nonnull (calloc (n, s)); 298 return check_nonnull (calloc (n, s));
299} 299}
300 300
301void * 301void *
302xicalloc (idx_t n, idx_t s) 302xicalloc (idx_t n, idx_t s)
303{ 303{
304 return nonnull (icalloc (n, s)); 304 return check_nonnull (icalloc (n, s));
305} 305}
306 306
307/* Clone an object P of size S, with error checking. There's no need 307/* Clone an object P of size S, with error checking. There's no need