# C struct garbage collection not run frequently enough

**URL:** <https://discourse.julialang.org/t/c-struct-garbage-collection-not-run-frequently-enough/116919>\
**Category:** General Usage\
**Tags:** garbage-collection, mutable-structure, c, gc\
**Created:** [July 11, 2024, 3:38pm UTC](https://discourse.julialang.org/t/c-struct-garbage-collection-not-run-frequently-enough/116919 "2024-07-11T15:38:28Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![vchuravy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vchuravy/32/8_2.png) [@vchuravy](https://discourse.julialang.org/u/vchuravy)\
**Post date:** [July 11, 2024, 9:08pm UTC](https://discourse.julialang.org/t/c-struct-garbage-collection-not-run-frequently-enough/116919/14 "2024-07-11T21:08:36Z")

</div>

You can use `jl_malloc`/`jl_calloc`/`jl_free` to allocate memory in a way that is visible to the GC. You could set a function pointer in your library to these functions, and then use that function pointer.

---

_[View the full topic](https://discourse.julialang.org/t/c-struct-garbage-collection-not-run-frequently-enough/116919)._
