GC conservatism -- again
Steven Schveighoffer
schveiguy at yahoo.com
Wed Dec 29 06:37:10 PST 2010
On Tue, 28 Dec 2010 01:23:22 -0500, Robert Jacques <sandford at jhu.edu>
wrote:
> First, I'd like to point out that precise scanning of the heap (and I'll
> assume this can be extended to globals), is a long standing enhancement
> request.
Yes, I know. Does it also do precise scanning of the stack and global/TLS
data? Because that also needs to happen (I think you need a lot more
compiler support for that) to really fix this problem.
> Second, the false pointer problem disappears (for practical purposes)
> when you move to 64-bit.
I'm not sure I like this "solution", but you are correct. This is
somewhat mitigated however by the way memory is allocated (I'm assuming
not sparsely throughout the address space, and also low in the address
space). It certainly makes it less likely that a 64-bit random long
points at data, but it's not inconceivable to have 32-bits of 0
interspersed with non-zero data. It might be likely to have a struct with
two ints back to back, where one int is frequently 0.
> Third, modern GCs (i.e. thread-local GCs) can further reduce the false
> pointer issue.
I'd rather have precise scanning :) There are issues with thread-local
GCs.
If we have the typeinfo of a memory block for the GC to parse, you can
also rule out cross-thread pointers without thread-local GCs (for unshared
data).
-Steve
More information about the Digitalmars-d
mailing list