I see the code generated by glue allows me to create a RocList with or without space for a ref count.
If a list isn’t ref counted, does that mean it will never get dropped?
Context: I have hosted functions that return a List, and Claude reached for the non-ref counted list when asked to implement them.
When I do return an ref counted list, should I be incrementing the ref count before I return it?
Ah, I typed this out on my phone when I wasn’t looking at the code. The flag is elements_refcounted, so it’s indicating whether list elements have ref counts that need to be decremented when we decref the list. Is that correct?
And the flag exists to signal the correct size of the list header so that it can support seamless slices? I realized that I’ve stumbled into trying to understand ref counting again :sweat_smile:
But if I’m correct in my understanding that I just need elements_refcouted to be true when the elements are heap allocated, that’s all I need for now.
Bryce Miller has marked this topic as resolved.
Last updated: Jul 23 2026 at 13:15 UTC