On Sun, Mar 16, 2014, at 08:55 PM, Michael Haberler wrote: > > Am 17.03.2014 um 01:47 schrieb John Kasunich <[email protected]>: > > > I must admit that it pains me a bit to use memcpy for > > an object that is at most 64 bits long. Doesn't memcpy > > have special code to detect and deal with things like > > overlapping blocks? Seems like overkill. > > Flatly I dont understand your priorities. > > Your overkill avoidance stunt manages to shave off maybe a whopping 3 > microseconds out of every LinuxCNC startup, at the cost of introducing an > assumption which might take hours or days of people's time to report, > identify and remove. What kind of achievement is that? I'm not on the same > page. > > - Michael >
I said I agreed with you about the risk. Something is probably getting lost in translation. The "it pains me" part refers to the fact that even though I know memcpy is the right approach for the reasons you cite, there is simply something about the way I look at things that says it is wasteful to have code checking for things that I know can't happen. I can't justify it, or even really explain it. Part of it is probably because I design mostly analog and power electronic hardware in real life. Hardware can't make library calls. Every circuit takes space and costs money, and if you put down ten copies of some generic design (equivalent to ten library calls), you will suffer in both cost and reliability compared to designing a circuit that is specific to the needs of the application. -- John Kasunich [email protected] ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
