Re: [PATCH v5 2/7] pretty: Allow %(trailers) options with explicit value

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

 



On Tue, Jan 29, 2019 at 07:45:06AM +0100, Anders Waldenborg wrote:

> > Instead of using "char buf[8]", just using a strbuf and avoidng
> > strlcpy() would make the code much better, I would think.
> 
> Yes, taking the heap allocation hit would most likely make the intent
> clearer.

If you can reuse the same struct and strbuf_reset() it each time, then
that amortizes the cost of the heap (to basically once per program run,
instead of once per commit).

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux