On Thursday, 16 June 2016 at 13:54:11 UTC, MMJones wrote:
Suppose one has something like
class foo
{
int[] x;
void bar()
{
x = [];
}
}
Does the GC trash the "cache" when calling bar or does it
realize that it can use the same memory for x and essentially
just shortens the
Suppose one has something like
class foo
{
int[] x;
void bar()
{
x = [];
}
}
Does the GC trash the "cache" when calling bar or does it realize
that it can use the same memory for x and essentially just
shortens the array?
Is it equivalent to setting length = 0?
I'm a bit
On 6/16/16 9:54 AM, MMJones wrote:
Suppose one has something like
class foo
{
int[] x;
void bar()
{
x = [];
}
}
Does the GC trash the "cache" when calling bar or does it realize that
it can use the same memory for x and essentially just shortens the array?
If you reassign