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

Re: [Xen-devel] find_next{,_zero}_bit() inconsistencies



>>> On 29.08.16 at 14:03, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 29/08/2016 12:59, Jan Beulich wrote:
>> in the context of
>> https://lists.xenproject.org/archives/html/xen-devel/2016-08/msg03068.html 
>> I once again came across the different behavior our various
>> implementations of the $subject functions, in particular their varying
>> handling of the offset argument being greater / greater-or-equal
>> the size argument. Shouldn't we settle on a single, uniform model,
>> which might be
>> 1) offset >= size is valid, returns size,
>> 2) offset == size is valid, returns size, offset > size is invalid,
>> 3) offset >= size is invalid.
>>
>> Thanks for opinions, Jan
> 
> A number of existing situations use size as an end sentinel, so option 3
> will probably break things.

But otoh the ARM32 variant looks broken even for offset == size
(when both are a multiple of 8 the first byte after the array would
get accessed).

> What did you have in mind for invalid?

ASSERT()

>  Option 2 is probably the better
> angle, especially for catching errors, but it is might show up some
> existing latently-buggy code which would also need fixing.

I agree - that's why I'm asking for opinions first.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.