Path: utzoo!utgpu!water!watmath!onfcanim!dave From: dave@onfcanim.UUCP (Dave Martindale) Newsgroups: comp.lang.c Subject: Re: Explanation, please! Message-ID: <15930@onfcanim.UUCP> Date: 29 Aug 88 18:01:20 GMT References: <638@paris.ICS.UCI.EDU> <634@proxftl.UUCP> <1988Aug28.031926.19222@utzoo.uucp> Reply-To: dave@onfcanim.UUCP (Dave Martindale) Organization: National Film Board / Office national du film, Montreal Lines: 16 In article <1988Aug28.031926.19222@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: > >In general, however, in the long run the correct way to implement bulk >data copying is to call "memcpy", which (in the long run) is likely >to be recognized and given special attention by most compilers. For the case of copying bytes, yes. But there are other operations done in tight loops that do a bit more work than a simple byte move, so memcpy is not usable, yet little enough that unrolling the loop is still worthwhile. Thus Duff's Device will remain useful, until all compilers are smart enough to do loop unrolling on their own. For example: move while packing or unpacking data, table lookup, perhaps CRC generation. Dave Martindale