-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
So. I've been puttering around starting to deal with making sure that Huo doesn't leak memory like a sieve, and have hit upon a problem. Namely, arrays.
It's generally pretty clear when to free a value. However, since arrays in values are referenced by reference, instead of by value, one can have multiple references to an array. This means that we cannot just always free the array when freeing a value (of type array).
Normally, this is dealt with in one of two ways. Either through reference counting, or via garbage collection. However, given that you want performance, neither is particularly appealing.
On a very related note, how do you wish the following to work? Or rather, what do you want it to print?
(let x [])
(let y x)
(push y 1)
(print x)
Should it print [1]? Or []?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels