# \#aliasing

**URL:** https://discourse.julialang.org/tag/aliasing/1651.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Performance of loops](https://discourse.julialang.org/t/performance-of-loops/118273)

<div class="topic-metadata">

**Author:** [@Matthijs\_1971](https://discourse.julialang.org/u/Matthijs_1971)\
**Replies:** 30\
**Last updated:** [August 19, 2024, 8:20pm UTC](https://discourse.julialang.org/t/performance-of-loops/118273 "2024-08-19T20:20:45Z")

</div>

Julia has several ways to define loops or repeat code, each with advantages and disadvantages. I am looking at the performance of some also inspired by previous posts on this forum. #!/usr/bin/env julia # https://disco…

---

## [What's Julia's memory model like; e.g. regarding aliasing?](https://discourse.julialang.org/t/whats-julias-memory-model-like-e-g-regarding-aliasing/12565)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 0\
**Last updated:** [July 21, 2018, 4:56pm UTC](https://discourse.julialang.org/t/whats-julias-memory-model-like-e-g-regarding-aliasing/12565 "2018-07-21T16:56:28Z")

</div>

For the longest time, C++ didn’t have a memory model (now it does, and e.g. CPUs x86 and ARM implement it). I know also that Java has a memory model, but never heard of other languages having defined. Can you assume Ju…

---

## [Are broadcast-assignment and \`copyto!\` safe with aliasing?](https://discourse.julialang.org/t/are-broadcast-assignment-and-copyto-safe-with-aliasing/111903)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 1\
**Last updated:** [March 20, 2024, 9:54pm UTC](https://discourse.julialang.org/t/are-broadcast-assignment-and-copyto-safe-with-aliasing/111903 "2024-03-20T21:54:13Z")

</div>

Are broadcast-assignment and copyto! between two AbstractVector objects guaranteed to be safe if the two vectors alias each other (in a non-crazy way)? I’m especially interested if copying from an array into itself is gu…

---

## [Memory aliasing rules and reinterpret](https://discourse.julialang.org/t/memory-aliasing-rules-and-reinterpret/109875)

<div class="topic-metadata">

**Author:** [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Replies:** 8\
**Last updated:** [February 7, 2024, 9:22pm UTC](https://discourse.julialang.org/t/memory-aliasing-rules-and-reinterpret/109875 "2024-02-07T21:22:14Z")

</div>

I wanted to ask about the julia aliasing rules for memory accesses. Unfortunately, the docs are not super clear about that, e.g. Julia currently uses LLVM’s Type Based Alias Analysis. To find the comments that documen…

---

## [What's the aliasing story in Julia](https://discourse.julialang.org/t/whats-the-aliasing-story-in-julia/102564)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 36\
**Last updated:** [August 9, 2023, 9:50pm UTC](https://discourse.julialang.org/t/whats-the-aliasing-story-in-julia/102564 "2023-08-09T21:50:31Z")

</div>

So let’s say I’m looking at a function that takes multiple mutable arguments, say, any! or extrema! or sortperm!, or sum!, or copyto!, or mul!. Who is responsible for handling aliasing? Am I ever allowed to pass in two o…

---

## [Examples of memory aliasing](https://discourse.julialang.org/t/examples-of-memory-aliasing/50382)

<div class="topic-metadata">

**Author:** [@wulpuqu](https://discourse.julialang.org/u/wulpuqu)\
**Replies:** 2\
**Last updated:** [November 18, 2020, 3:14pm UTC](https://discourse.julialang.org/t/examples-of-memory-aliasing/50382 "2020-11-18T15:14:35Z")

</div>

Hello, I was reading the definition of AbstractArray in Base and I was searching for concrete cases of memory aliasing with two AbstractArrays. A simple case with SubArrays. julia\> A=randn(10) julia\> Base.mightalias(…
