<p dir="auto">I noticed that we may be using <code class="notranslate">memcpy</code> unsafely in some places.  e.g. <code class="notranslate">unsafe_copy!</code> in <code class="notranslate">array.jl</code> uses <code class="notranslate">memcpy</code>, but if you do e.g. <code class="notranslate">copy!(A,A)</code> then the source and destination data overlap.  (This is unlikely to fail in practice, but strictly speaking violates the <code class="notranslate">memcpy</code> spec.)</p>
<p dir="auto">Would be good to do an audit of all <code class="notranslate">memcpy</code> uses in Julia and replace them with <code class="notranslate">memmove</code> if there is any chance of overlapping data.  The performance impact should be negligible.</p>
<p dir="auto">The following code flip-flop between the two indentations when indenting the whole file. Note that the second screenshot has a leading space while the first one doesn't.</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="(1)"><pre class="notranslate">(<span class="pl-c1">1</span>)</pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/712232/9156618/68cca358-3eae-11e5-98af-1321dc754eb0.png"><img src="https://cloud.githubusercontent.com/assets/712232/9156618/68cca358-3eae-11e5-98af-1321dc754eb0.png" alt="no space" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/712232/9156620/73ee8396-3eae-11e5-93e0-d2deb36541e6.png"><img src="https://cloud.githubusercontent.com/assets/712232/9156620/73ee8396-3eae-11e5-93e0-d2deb36541e6.png" alt="with space" style="max-width: 100%;"></a></p>