Date: Mon, 14 Jul 1997 13:53:25 -0700 (PDT) Message-Id: <199707142053.NAA13035@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Alan DOT Poppleton AT wanadoo DOT fr From: Nate Eldredge Subject: Re: mem copies Cc: djgpp AT delorie DOT com Precedence: bulk You wrote: >I have allocated two memory blocks with the malloc function. What is >the fastest method of copying from one to the other? Would assembler >help? If so what is the code? I am currently using memcpy to copy but I >need to be as fast as possible. With optimizations turned on, GCC puts memcpy inline, using movsl as much as possible. I doubt you'll get much faster than that. > Also is there are faster method of >setting a chunk of memory to a certain value than the memset function. You could theoretically write it in inline assembly, but memset is already written in assembler, so all you'd save would be some very slight overhead of the call. Sorry. TANSTAAFL Nate Eldredge eldredge AT ap DOT net