/* 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; }
/* 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; }