std.allocator needs your help

ponce contact at gam3sfrommars.fr
Thu Oct 24 01:49:33 PDT 2013


On Monday, 23 September 2013 at 15:56:11 UTC, ponce wrote:
> On Monday, 23 September 2013 at 15:45:25 UTC, Andrei 
> Alexandrescu wrote:
>> On 9/23/13 7:22 AM, ponce wrote:
>>
>> One question: what circumstances require run-time alignment 
>> values, and what values would those be? I'm currently under 
>> the assumption that alignments are known during compilation.
>>
>>
>> Thanks,
>>
>> Andrei
>
> I don't know of a use case for run-time alignment values.

Actually there is at least one scenario in which run-time 
alignment values is required.
Using "true sharing" for OpenCL memory objects requires to first 
get the necessary alignement through an API call then passing 
accordingly aligned buffers.
It can requires alignement as high as 4096 bytes. Same business 
with OpenGL.

Just stumbled upon this problem in C++ which prevent to use a 
custom C++ STL allocator.


More information about the Digitalmars-d mailing list