[vlc-commits] Add xcalloc(). Do not use this in new code!
Rémi Denis-Courmont
git at videolan.org
Mon Jul 11 21:38:10 CEST 2011
vlc/vlc-1.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 10 23:21:23 2011 +0300| [7402eee9430fedd258934a4a3e5bd38b21de129d] | committer: Rémi Denis-Courmont
Add xcalloc(). Do not use this in new code!
(cherry picked from commit c1f0e3ce2323f66c99f34065fad62de2c3cbe8d8)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=7402eee9430fedd258934a4a3e5bd38b21de129d
---
include/vlc_common.h | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/include/vlc_common.h b/include/vlc_common.h
index 6855d33..2c36a96 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -889,6 +889,14 @@ static inline void *xrealloc (void *ptr, size_t len)
return nptr;
}
+static inline void *xcalloc (size_t n, size_t size)
+{
+ void *ptr = calloc (n, size);
+ if (unlikely (ptr == NULL))
+ abort ();
+ return ptr;
+}
+
/*****************************************************************************
* libvlc features
*****************************************************************************/
More information about the vlc-commits
mailing list