qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 4/4] semihosting: add --semihosting-config arg s


From: Liviu Ionescu
Subject: Re: [Qemu-devel] [PATCH 4/4] semihosting: add --semihosting-config arg sub-argument
Date: Thu, 7 May 2015 09:51:38 +0300

> On 06 May 2015, at 17:57, Leon Alrae <address@hidden> wrote:
> 
> +static int add_semihosting_arg(const char *name, const char *val, void 
> *opaque)
> +{
> +    SemihostingConfig *s = opaque;
> +    if (strcmp(name, "arg") == 0) {
> +        s->argc++;
> +        s->argv = g_realloc(s->argv, s->argc * sizeof(void *));
> +        s->argv[s->argc - 1] = val;
> +    }
> +    return 0;
> +}

being done at init time probably it has no impact, but, as a matter of style, I 
would avoid iterating realloc when the buffer size is actually known.

is it that difficult to count the "arg"s and correctly alloc the array?


regards,

Liviu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]