2011/1/28 Eric Blake :
> [replying to myself - never a good sign on Friday afternoon]
>
> On 01/28/2011 02:59 PM, Eric Blake wrote:
>>> +/* divide value by size, rounding up */
>>> +# define VIR_DIV_UP(value, size) (((value) + (size) - 1) / (size))
>>
>> Hmm - now that we are codifying it, can we m
[replying to myself - never a good sign on Friday afternoon]
On 01/28/2011 02:59 PM, Eric Blake wrote:
>> +/* divide value by size, rounding up */
>> +# define VIR_DIV_UP(value, size) (((value) + (size) - 1) / (size))
>
> Hmm - now that we are codifying it, can we make it less prone to
> overflow
On 01/28/2011 02:14 PM, Matthias Bolte wrote:
> Use it in all places where a memory or storage request size is converted
> to a larger granularity. This avoids requesting too small memory or storage
> sizes that could result from the truncation done by a simple division.
Much nicer than open-codin