August 09, 2020 Re: __vector(ubyte[32]) misalignment | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | On Sunday, 9 August 2020 at 12:37:06 UTC, Steven Schveighoffer wrote:
> On 8/9/20 8:09 AM, Bruce Carneal wrote:
>> [...]
>
> All blocks in the GC that are more than 16 bytes are aligned by 32 bytes. You shouldn't have any 16 byte blocks here, because each element is 32 bytes long.
>
> However, if your block grows to a page size, the alignment will be 16 bytes off (due to the metadata stored at the front of the block).
>
> A page size is 4096 bytes. So anything larger than 2048 will require a page-sized block or larger.
>
> I would guess that once your array gets longer than.... 63 elements, it's always misaligned?
Quality sleuthing Steve. The program says it found misalignments with 37 out of 100 attempts of length [1..100].
|
August 10, 2020 Re: __vector(ubyte[32]) misalignment | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | On 8/9/20 8:46 AM, Steven Schveighoffer wrote: > On 8/9/20 8:37 AM, Steven Schveighoffer wrote: > >> I think this has come up before, there may even be a bug report on it. > > Found one, I'll see if I can fix the array runtime: > > https://issues.dlang.org/show_bug.cgi?id=10826 > Bruce, I have a PR to hopefully fix these issues, if you want to test against it: https://github.com/dlang/druntime/pull/3192 -Steve |
August 10, 2020 Re: __vector(ubyte[32]) misalignment | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | On Monday, 10 August 2020 at 13:52:46 UTC, Steven Schveighoffer wrote:
> On 8/9/20 8:46 AM, Steven Schveighoffer wrote:
>> On 8/9/20 8:37 AM, Steven Schveighoffer wrote:
>>
>>> I think this has come up before, there may even be a bug report on it.
>>
>> Found one, I'll see if I can fix the array runtime:
>>
>> https://issues.dlang.org/show_bug.cgi?id=10826
>>
>
> Bruce, I have a PR to hopefully fix these issues, if you want to test against it:
>
> https://github.com/dlang/druntime/pull/3192
>
> -Steve
The "fix issue 10826" reading was interesting. Thanks for pushing this one through.
|
August 10, 2020 Re: __vector(ubyte[32]) misalignment | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | On Monday, 10 August 2020 at 13:52:46 UTC, Steven Schveighoffer wrote:
> On 8/9/20 8:46 AM, Steven Schveighoffer wrote:
>> On 8/9/20 8:37 AM, Steven Schveighoffer wrote:
>>
>>> I think this has come up before, there may even be a bug report on it.
>>
>> Found one, I'll see if I can fix the array runtime:
>>
>> https://issues.dlang.org/show_bug.cgi?id=10826
>>
>
> Bruce, I have a PR to hopefully fix these issues, if you want to test against it:
>
> https://github.com/dlang/druntime/pull/3192
>
> -Steve
No biggee but it looks like there is some duplicate code at the end of the __alignPad unittest.
|
August 10, 2020 Re: __vector(ubyte[32]) misalignment | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bruce Carneal | On 8/10/20 2:53 PM, Bruce Carneal wrote: > No biggee but it looks like there is some duplicate code at the end of the __alignPad unittest. Hah! I think I copy-pasted that intending to write a new test, but then tried it separately and found another issue (typeid(__vector(ubyte[32])).talign returned 16!) So I forgot to go back in and delete that case. Thanks -Steve |
Copyright © 1999-2021 by the D Language Foundation