__vector(ubyte[32]) misalignment

Bruce Carneal bcarneal at gmail.com
Sun Aug 9 13:52:38 UTC 2020


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].



More information about the Digitalmars-d-learn mailing list