V version: 0.1.24
OS: Windows 7
What did you do?
Run the following program:
fn main()
{
for i := 1; i < 100000000; i++
{
a := [1, 2, 3]
}
}
What did you expect to see?
A small and limited amount of RAM is allocated for a local array
What did you see instead?
Allocated RAM grows infinitely until the whole system hangs.
The C listing shows that no attempt is made to free memory allocated at each loop iteration:
void main__main () {
for (
int i= 1 ; i < 100000000 ; i ++ ) {
array_int a=new_array_from_c_array(3, 3, sizeof(int), EMPTY_ARRAY_OF_ELEMS( int, 3 ) { 1 , 2 , 3 }) ;
}
;
}
Memory management isn't ready yet unfortunately.
What memory management approach are you going to adopt? I see three possible ways, but none of them seems to me feasible:
I've read from V Discord channel that it's going to be similar to this https://aardappel.github.io/lobster/memory_management.html
Most helpful comment
What memory management approach are you going to adopt? I see three possible ways, but none of them seems to me feasible: