qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3] net.c: Moved large array in nc_sendv_compat


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v3] net.c: Moved large array in nc_sendv_compat from the stack to the heap
Date: Mon, 14 Mar 2016 17:22:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0


On 14/03/2016 16:32, Eric Blake wrote:
>> +    const size_t STACKBUF_SIZE = 2048;
>> +
>> +    uint8_t *buffer, *dynbuf = NULL;
>> +    uint8_t stackbuf[STACKBUF_SIZE];

Instead of using the "STACKBUF_SIZE" constant, you can use just
"stackbuf[2048]", and then use sizeof(stackbuf) below.  This is even
more future proof.

Paolo



reply via email to

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