예제 #1
0
파일: HTS_misc.c 프로젝트: A-L-E-X/RHVoice
/* HTS_calloc: wrapper for calloc */
char *HTS_calloc(const size_t num, const size_t size)
{
#ifdef FESTIVAL
   char *mem = (char *) safe_wcalloc(num * size);
#else
   char *mem = (char *) calloc(num, size);
#endif                          /* FESTIVAL */

   if (mem == NULL)
      HTS_error(1, "HTS_calloc: Cannot allocate memory.\n");

   return mem;
}
예제 #2
0
/* HTS_calloc: wrapper for calloc */
void *HTS_calloc(const size_t num, const size_t size)
{
   size_t n = num * size;
#ifdef FESTIVAL
   void *mem = (void *) safe_wcalloc(n);
#else
   void *mem = (void *) malloc(n);
#endif                          /* FESTIVAL */

   memset(mem, 0, n);

   if (mem == NULL)
      HTS_error(1, "HTS_calloc: Cannot allocate memory.\n");

   return mem;
}