memcpy versus assignment

Scott Amspoker scott at bbxsda.UUCP
Fri Jan 5 02:26:01 AEST 1990


I recall a '286 C compiler that generated a series of MOVS instructions
to move structures.  I figured that for small structures this was
faster than the overhead required to call a memcpy() routine.  Just
for yuks one day I defined a structure with a 1000 element int array
in it.  The C compiler generated tons and tons of MOVS instructions (talk
about un-rolling a loop :-).

-- 
Scott Amspoker
Basis International, Albuquerque, NM
(505) 345-5232
unmvax.cs.unm.edu!bbx!bbxsda!scott



More information about the Comp.lang.c mailing list