[Top][All Lists]

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

Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] include: Auto-generate the siz

From: Leonid Bloch
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] include: Auto-generate the sizes lookup table
Date: Fri, 4 Jan 2019 21:23:27 +0000

On 1/4/19 12:31 PM, Alberto Garcia wrote:
> On Thu 03 Jan 2019 10:42:30 PM CET, Eric Blake wrote:
>> In my view, code generators make sense when used on code that is
>> expected to change over time (a good example is QAPI because we add
>> new commands every release; other places might be a generator to help
>> deal with syscall handlers since newer kernels can add a syscall; or
>> even the fact that we have used some powerful GNU make textual
>> processing to make it easy to add files to particular subsets of the
>> build with as few lines edited as possible), where the goal is that
>> the generator gives you both a compact representation that is easier
>> to edit, and that the expansion from the generator ensures that
>> repetitive boilerplate is formed without typos.  In short, if a
>> generator results in a net reduction in lines of edited source in
>> relation to the lines it produces, AND if the source that gets
>> regenerated is likely to change, then it makes total sense to spend
>> time on the generator.  But when the amount of effort to write a
>> generator costs as much as just hard-coding the list outright,
>> especially when the list is not going to change (there really aren't
>> any other powers of 2 within 64 bits), I'm not sure a generator adds
>> any value.
> I agree with Eric.

Fine with me. I just thought that in the previous conversation 
(https://patchwork.kernel.org/patch/10666975/#22302435) we have agreed 
that I'll send this patch. I've sent v2 already with Phil's suggestions 
included, please feel free to pull it if desired.


> Berto

reply via email to

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