Optimization problem: bulk Boolean operations on vectors
Stefan Koch via Digitalmars-d
digitalmars-d at puremagic.com
Fri Dec 23 17:57:12 PST 2016
On Saturday, 24 December 2016 at 01:38:24 UTC, safety0ff wrote:
> On Friday, 23 December 2016 at 22:11:31 UTC, Walter Bright
> wrote:
>>
>> For this D code:
>>
>> enum SIZE = 100000000;
>>
>> void foo(int* a, int* b) {
>> int* atop = a + 1000;
>> ptrdiff_t offset = b - a;
>> for (; a < atop; ++a)
>> *a &= *(a + offset);
>> }
>
> Is subtraction of pointers which do not belong to the same
> array defined behavior in D?
Yes, I think so.
There are not crazy rules to make pointer math ub.
More information about the Digitalmars-d
mailing list