Generating struct .init at run time?

Patrick Schluter Patrick.Schluter at bbox.fr
Thu Jul 2 10:29:18 UTC 2020


On Thursday, 2 July 2020 at 07:51:29 UTC, Ali Çehreli wrote:
> Normally, struct .init values are known at compile time. 
> Unfortunately, they add to binary size:
>
> [...]
memset() is the function you want. The initializer is an element 
generated in the data segment (or in a read only segment) that 
will be copied to the variable by a internal call to memcpy. The 
same happens in C except that the compilers are often clever and 
replace the copy by a memset().





More information about the Digitalmars-d-learn mailing list