Exercise 7
Verfasst: 31. Jan 2019 18:28
Hi I am studying Exercise 7 now and I have questions in Task2.
At Task2-1,
we have to do non-moving GC.
This is what I thought how to do it:
Env: res->15
so need to follow the reference.
like this: (loc, Value) = (15, Box(14)) and then, (14, 11), then , (11, Box(10)), (10, Box(6)), (6, 5), (5, Box(4)), (4, Num(11).
I just need to follow the location that the value refers.
As a result, loc(15, 14, 11, 10, 6, 5, 4) are marked.
However, if I do it like this way, loc 12 is unmarked.
But the answer says loc 12 is marked and it wasn't swept after GC.
Is my thought wrong?
+) I feel little bit confused about the gap between lecture and the exercise..
in the exercise solution, I can get the Int type data (e.g. (loc, val) = (14, 11)).
However, in the def allAddrInVal (from SRCFLAEInterpWithGC.scala),
this Int data is the 'case NumV(_)' and results Set().
Then back to def mark,
newAddresses becomes empty. -> no marking from now
It is so hard to explain what I am confused of.
If you don't understand what I mean, just comment under my text.
At Task2-1,
we have to do non-moving GC.
This is what I thought how to do it:
Env: res->15
so need to follow the reference.
like this: (loc, Value) = (15, Box(14)) and then, (14, 11), then , (11, Box(10)), (10, Box(6)), (6, 5), (5, Box(4)), (4, Num(11).
I just need to follow the location that the value refers.
As a result, loc(15, 14, 11, 10, 6, 5, 4) are marked.
However, if I do it like this way, loc 12 is unmarked.
But the answer says loc 12 is marked and it wasn't swept after GC.
Is my thought wrong?
+) I feel little bit confused about the gap between lecture and the exercise..
in the exercise solution, I can get the Int type data (e.g. (loc, val) = (14, 11)).
However, in the def allAddrInVal (from SRCFLAEInterpWithGC.scala),
this Int data is the 'case NumV(_)' and results Set().
Then back to def mark,
newAddresses becomes empty. -> no marking from now
It is so hard to explain what I am confused of.
If you don't understand what I mean, just comment under my text.