Can't implement conformant memset/memcpy without compiler -ffreestanding support

rikki cattermole rikki at cattermole.co.nz
Wed Jul 25 09:55:28 UTC 2018


On 25/07/2018 9:48 PM, Zheng (Vic) Luo wrote:
> 
> First, IIRC, the name hacking is a technique used to bypass llvm 
> optimizers, I'm not sure if it also applies to gdc. Moreover, I think 
> this *is* a hack around compiler because this forces memset implementer 
> to write all code in that function.

I won't call it a hack. Because memset obviously can't go on to call memset.

Realistically, the default case that uses D itself, won't need more than 
a single function to implement. For optimized versions you must use 
assembly. Where the problem won't manifest anyway.

However this would be a wonderful candidate for a pragma to disable the 
calling to memset and friends.


More information about the Digitalmars-d mailing list