memcpy, memset, memcmp and friends in the D Runtime

Dmitry Olshansky dmitry.olsh at gmail.com
Sat Apr 12 10:00:19 PDT 2014


12-Apr-2014 00:25, monarch_dodra пишет:
> On Friday, 11 April 2014 at 20:17:35 UTC, Brad Anderson wrote:
>> This list of secure alternatives to C functions Microsoft has would
>> probably be a good source of inspiration when deciding what functions
>> should be considered for reimplementation:
>>
>> http://msdn.microsoft.com/en-us/library/wd3wzwts.aspx%7C%7Clist
>
> I just wrote this as a rough draft. I'll make "formal" announcement for
> it sometime soon, if initial feedback is positive.
>
> http://wiki.dlang.org/DIP59

Some thoughts.

Provide only bitwise comparison, search etc. It's the only case that can 
reliably benefit from SIMD or hand-written ASM, has problem with CTFE 
support, etc. Then requiring that T be a POD or built-in type is fine IMHO.

Maybe go for copy ---> rawCopy, find --> rawFind (i.e. model after 
std.algorithm) rather then mimicking C functions. This way we are open 
to a superset of C-runtime ;)



-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list