G
Ganesh
Hi,
How does a garbage collector (in C++), like mark and sweep, work on
heap
allocated arrays? In this case,
1. The only live variable on stack that points to the memory may be the
one that holds the starting address of the array. Or,
2. There could be a stack variable that points to an address that is,
say, in the middle of the array.
How does GC mark the entire array as live in these cases?
Thanks,
Ganesh
How does a garbage collector (in C++), like mark and sweep, work on
heap
allocated arrays? In this case,
1. The only live variable on stack that points to the memory may be the
one that holds the starting address of the array. Or,
2. There could be a stack variable that points to an address that is,
say, in the middle of the array.
How does GC mark the entire array as live in these cases?
Thanks,
Ganesh