Mail Archives: djgpp/1997/07/14/16:55:17
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
- Raw text -