# Use "memcpy" instead of "memmove" to copy Array when there's no overlap?

**URL:** https://discourse.julialang.org/t/use-memcpy-instead-of-memmove-to-copy-array-when-theres-no-overlap/64042
**Category:** Internals & Design
**Created:** [July 4, 2021, 3:18pm UTC](https://discourse.julialang.org/t/use-memcpy-instead-of-memmove-to-copy-array-when-theres-no-overlap/64042 "2021-07-04T15:18:33Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [July 16, 2021, 8:36am UTC](https://discourse.julialang.org/t/use-memcpy-instead-of-memmove-to-copy-array-when-theres-no-overlap/64042/7 "2021-07-16T08:36:24Z")

</div>

> [@N5N3](#):
>
> It seems `memcpy!` call memmove, while `memmove!` call memcpy. Is it a bug, or just a typo Error?

> <https://github.com/JuliaLang/julia/issues/29588>
>
> \`code\_native\` gives nonsense for the names of some functions on latest master. …For example, consider the annotation next to the \`callq\` below:
> 
> \`\`\`
> $ ./julia 
> \_
> \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org
> (\_) | (\_) (\_) |
> \_ \_ \_| |\_ \_\_ \_ | Type "?" for help, "\]?" for Pkg help.
> | | | | | | |/ \_\` | |
> | | |\_| | | | (\_| | | Version 1.1.0-DEV.440 (2018-10-10)
> \_/ |\\\_\_'\_|\_|\_|\\\_\_'\_| | Commit e20d1ee686\* (0 days old master)
> |\_\_/ |
> 
> julia\> code\_native(maximum, Tuple{Vector{Int}})
> .text
> ; Function maximum {
> ; Location: reducedim.jl:645
> ; Function #maximum#541; {
> ; Location: reducedim.jl:645
> ; Function \_maximum; {
> ; Location: reducedim.jl:649
> ; Function \_maximum; {
> ; Location: reducedim.jl:650
> ; Function mapreduce; {
> ; Location: reducedim.jl:301
> ; Function #mapreduce#535; {
> ; Location: reducedim.jl:301
> ; Function \_mapreduce\_dim; {
> ; Location: reducedim.jl:645
> pushq	%rax
> callq	"size;"
> ;}}}}}}
> popq	%rcx
> retq
> nopl	(%rax,%rax)
> ;}
> \`\`\`
> 
> I came across this while searching for the cause of the segfault in the tests over at https://github.com/JuliaLang/julia/pull/28878 (https://travis-ci.org/JuliaLang/julia/jobs/438390168).
> 
> Possibly related: https://github.com/JuliaLang/julia/issues/28046

---

_[View the full topic](https://discourse.julialang.org/t/use-memcpy-instead-of-memmove-to-copy-array-when-theres-no-overlap/64042)._
