[vlc-commits] Add xcalloc(). Do not use this in new code!
Rémi Denis-Courmont
git at videolan.org
Mon Jul 11 20:24:39 CEST 2011
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul 10 23:21:23 2011 +0300| [c1f0e3ce2323f66c99f34065fad62de2c3cbe8d8] | committer: Rémi Denis-Courmont
Add xcalloc(). Do not use this in new code!
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c1f0e3ce2323f66c99f34065fad62de2c3cbe8d8
---
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 fe7d9dd..103f2d0 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -870,6 +870,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