diff options
Diffstat (limited to 'gl/xmalloc.c')
-rw-r--r-- | gl/xmalloc.c | 16 |
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 | ||
32 | static void * _GL_ATTRIBUTE_PURE | 32 | static void * _GL_ATTRIBUTE_PURE |
33 | nonnull (void *p) | 33 | check_nonnull (void *p) |
34 | { | 34 | { |
35 | if (!p) | 35 | if (!p) |
36 | xalloc_die (); | 36 | xalloc_die (); |
@@ -42,13 +42,13 @@ nonnull (void *p) | |||
42 | void * | 42 | void * |
43 | xmalloc (size_t s) | 43 | xmalloc (size_t s) |
44 | { | 44 | { |
45 | return nonnull (malloc (s)); | 45 | return check_nonnull (malloc (s)); |
46 | } | 46 | } |
47 | 47 | ||
48 | void * | 48 | void * |
49 | ximalloc (idx_t s) | 49 | ximalloc (idx_t s) |
50 | { | 50 | { |
51 | return nonnull (imalloc (s)); | 51 | return check_nonnull (imalloc (s)); |
52 | } | 52 | } |
53 | 53 | ||
54 | char * | 54 | char * |
@@ -72,7 +72,7 @@ xrealloc (void *p, size_t s) | |||
72 | void * | 72 | void * |
73 | xirealloc (void *p, idx_t s) | 73 | xirealloc (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) | |||
90 | void * | 90 | void * |
91 | xireallocarray (void *p, idx_t n, idx_t s) | 91 | xireallocarray (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) | |||
295 | void * | 295 | void * |
296 | xcalloc (size_t n, size_t s) | 296 | xcalloc (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 | ||
301 | void * | 301 | void * |
302 | xicalloc (idx_t n, idx_t s) | 302 | xicalloc (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 |