# Cfunction result garbage collected?

**URL:** <https://discourse.julialang.org/t/cfunction-result-garbage-collected/747>\
**Category:** General Usage\
**Tags:** question\
**Created:** [December 5, 2016, 9:15pm UTC](https://discourse.julialang.org/t/cfunction-result-garbage-collected/747 "2016-12-05T21:15:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![barche](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barche/32/79_2.png) [@barche](https://discourse.julialang.org/u/barche)\
**Post date:** [December 5, 2016, 9:15pm UTC](https://discourse.julialang.org/t/cfunction-result-garbage-collected/747/1 "2016-12-05T21:15:33Z")

</div>

Hi,

Is there a risk that the data pointed to by the pointer returned from `cfunction` will be garbage collected, or can it be stored on the C side without precautions?

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [December 5, 2016, 9:22pm UTC](https://discourse.julialang.org/t/cfunction-result-garbage-collected/747/2 "2016-12-05T21:22:04Z")

</div>

No, the function pointer will not be free’d.
