# What's the macro to prevent a vector from moving memory location during a function call?

**URL:** https://discourse.julialang.org/t/whats-the-macro-to-prevent-a-vector-from-moving-memory-location-during-a-function-call/31250
**Category:** New to Julia
**Created:** [November 19, 2019, 5:38am UTC](https://discourse.julialang.org/t/whats-the-macro-to-prevent-a-vector-from-moving-memory-location-during-a-function-call/31250 "2019-11-19T05:38:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)
#### Post date: [November 19, 2019, 5:38am UTC](https://discourse.julialang.org/t/whats-the-macro-to-prevent-a-vector-from-moving-memory-location-during-a-function-call/31250/1 "2019-11-19T05:38:51Z")

</div>

I think it belongs to `GC` but I can’t remember the macro name.

---

<div class="post-metadata">

### Author: ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)
#### Post date: [November 19, 2019, 6:02am UTC](https://discourse.julialang.org/t/whats-the-macro-to-prevent-a-vector-from-moving-memory-location-during-a-function-call/31250/2 "2019-11-19T06:02:34Z")

</div>

[`GC.@preserve`](https://docs.julialang.org/en/v1/base/base/#Base.GC.@preserve) maybe?
