memcpy, memset, memcmp and friends in the D Runtime

Mike none at none.com
Mon Apr 7 04:51:38 PDT 2014


I'm trying to port the D Runtime to a bare metal platform.  In 
the short time I've been doing bare metal work, I've come to rely 
on two very fundamental methods: memcpy and memset.  In my D 
runtime, however, I'm not using the C standard library; I'm doing 
it all in D.

It seems the D Runtime and Phobos also often make use of memcpy 
and memset, but they do so through core.stdc which doesn't appear 
to be part of the D Runtime.  Was this just a matter of 
convenience or thoughtful design?  I'm guessing the former based 
on the fact that core.stdc is not in the official language 
reference.

So, I would like to know what the design philosophy is for 
fundamental memory utilities like memcpy, memset, memcmp etc..., 
because I need them and would like to implement harmony with D's 
design.

* Were these methods intentionally omitted from the D Runtime, or 
just taken for granted since they were so conveniently available 
in the C standard library?

* Should they be added to core.memory or some other module and 
exposed as official, supported, methods of the D Runtime 
(hopefully changing their names)?

Please advise.

Thanks,
Mike


More information about the Digitalmars-d mailing list