]> git.sesse.net Git - vlc/commitdiff
Add xcalloc(). Do not use this in new code!
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 10 Jul 2011 20:21:23 +0000 (23:21 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 11 Jul 2011 18:24:35 +0000 (21:24 +0300)
include/vlc_common.h

index fe7d9dd829cd81b95d80670087260a1c93973bfa..103f2d018bb35c94ba6b04b667a145892243982d 100644 (file)
@@ -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
  *****************************************************************************/