qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH 2/3] block: Emit modules in bdrv_iterate_format(


From: Hao QingFeng
Subject: Re: [Qemu-block] [PATCH 2/3] block: Emit modules in bdrv_iterate_format()
Date: Wed, 2 Nov 2016 19:59:58 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0



在 2016-11-02 19:15, Kevin Wolf 写道:
Am 02.11.2016 um 11:52 hat Hao QingFeng geschrieben:
Sorry for a bit late response. The function looks fine but just some
doubt on g_renew in this piece of code(and the legacy), does
g_renew(realloc) has much performance impact if it's call many times
since alloc and memory copy are both also run many times?  So how
about increase the memory for more instead of 1 each time?

formats = g_renew(const char *, formats, count + 10);

A new counter also needs to be introduced to record the space size.
This code is not on a hot path, so keeping the code simple and easy to
maintain is preferrable to complicating it just so --help can save a few
CPU cycles.
Got it. thanks!
Kevin


--
QingFeng Hao(Robin)




reply via email to

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