diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2025-01-30 08:06:24 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2025-02-05 12:35:16 +0000 |
| commit | aae794e9bdd5f19019560041479cf7ebc46b4fa5 (patch) | |
| tree | 9081f69f3e50dfffbcfb6e56169476cbae7e926c /xmalloc.c | |
| parent | box-drawings: handle architecture with soft-float (diff) | |
xmalloc: add xreallocarray()
Diffstat (limited to 'xmalloc.c')
| -rw-r--r-- | xmalloc.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -36,6 +36,13 @@ xrealloc(void *ptr, size_t size) return unlikely(size == 0) ? alloc : check_alloc(alloc); } +void * +xreallocarray(void *ptr, size_t n, size_t size) +{ + void *alloc = reallocarray(ptr, n, size); + return unlikely(size == 0) ? alloc : check_alloc(alloc); +} + char * xstrdup(const char *str) { |
