I have two questions.
Do realloc()
and memcpy()
copy the entries in an array to another in a way faster than just iterating on eac
The x86 has special instructions for scanning and matching a byte/word in a block of memory as well and one that can be used to copy a block of memory (it is a CISC cpu after all). A lot of C compilers that implement inline assembly language and a pragma to do inlining of entire functions have for many many years taken advantage of this in their library functions.
The ones used for mem copy are movsb/movsw in combination to the rep instruction.
CMPS/MOVS/SCAS/STOS
REP, REPE, REPNE, REPNZ, REPZ
Setup registers with src/trg addresses and int count and away you go.