Summary: Static data that must be scanned by the GC should be
Version: D1 & D2
--- Comment #0 from Leandro Lucarella <llu...@gmail.com> 2010-08-15 16:56:49
Now the GC scans all the static data of the program, since it uses the libc
variables __data_start and _end to get its limits.
There is a lot of stuff in the static data that doesn't need to be scanned,
most notably the TypeInfos[*], which is a great portion of the static data. C
libraries static data, for example, would be scanned too, when it makes no
sense to do so.
I experience a 20% increment in the total static data of a small program by
just adding about 5 more types to the GC implementation, which translate to a
appreciable loss in performance because of the extra scanning and probably the
extra false pointers.
It would be nice if the compiler could group all the static that must really be
scanned (programs static variables) together and make its limits available to
the GC. It would be even nicer to leave static variables that have no pointers
out of that group, and even much more nicer to create a pointer map like the
one in the patch from bug 3463 to allow precise heap scanning. That way the
only memory in the program that would have to be scanned conservatively will be
[*] This is not entirely true, since IIRC the TypeInfo store the .init
property, which can be overwritten by the user, storing a pointer to the GC
heap there, but I think is a rare enough case to be considered, I think
imposing that limitation would be a problem in real life programs.
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------