Add 'scm_gc_typed_calloc' macro.
authorMark H Weaver <mhw@netris.org>
Sun, 31 Mar 2013 03:09:01 +0000 (23:09 -0400)
committerMark H Weaver <mhw@netris.org>
Mon, 1 Apr 2013 20:09:57 +0000 (16:09 -0400)
* libguile/gc.h (scm_gc_typed_calloc): New macro.

libguile/gc.h

index 9f00e01..a9a499b 100644 (file)
@@ -3,7 +3,8 @@
 #ifndef SCM_GC_H
 #define SCM_GC_H
 
-/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006,
+ *   2007, 2008, 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -207,6 +208,7 @@ SCM_API char *scm_gc_strdup (const char *str, const char *what)
 SCM_API char *scm_gc_strndup (const char *str, size_t n, const char *what)
   SCM_MALLOC;
 
+#define scm_gc_typed_calloc(t) ((t *) scm_gc_calloc (sizeof (t), #t))
 
 #ifdef BUILDING_LIBGUILE
 #include "libguile/bdw-gc.h"