if (n <= 1)
return;
- j = b = alloca(sizeof(CalendarComponent*) * n);
+ j = b = newa(CalendarComponent*, n);
for (i = *c; i; i = i->next)
*(j++) = i;
va_end(ap);
/* Allocate strv */
- l = alloca(sizeof(char *) * (n + 1));
+ l = newa(char*, n + 1);
/* Fill in arguments */
va_start(ap, path);
if (!terminal_is_dumb())
fputs(ANSI_HOME_CLEAR, stdout);
- array = alloca(sizeof(Group*) * hashmap_size(a));
+ array = newa(Group*, hashmap_size(a));
HASHMAP_FOREACH(g, a, i)
if (g->n_tasks_valid || g->cpu_valid || g->memory_valid || g->io_valid)
#endif
/* alloca() can't take 0, hence let's allocate at least one */
- items = alloca(sizeof(EntryItem) * MAX(1u, n_iovec));
+ items = newa(EntryItem, MAX(1u, n_iovec));
for (i = 0; i < n_iovec; i++) {
uint64_t p;
n = journal_file_entry_n_items(o);
/* alloca() can't take 0, hence let's allocate at least one */
- items = alloca(sizeof(EntryItem) * MAX(1u, n));
+ items = newa(EntryItem, MAX(1u, n));
for (i = 0; i < n; i++) {
uint64_t l, h;
assert_return(iov, -EINVAL);
assert_return(n > 0, -EINVAL);
- niov = alloca(sizeof(struct iovec) * (n + 3));
+ niov = newa(struct iovec, (n + 3));
memcpy(niov, iov, sizeof(struct iovec) * n);
ALLOCA_CODE_FUNC(f, func);
ngroups_max = sysconf(_SC_NGROUPS_MAX);
assert(ngroups_max > 0);
- gids = alloca(sizeof(gid_t) * ngroups_max);
+ gids = newa(gid_t, ngroups_max);
ngroups = getgroups(ngroups_max, gids);
assert(ngroups >= 0);