Summary: Static data that must be scanned by the GC should be
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD

--- Comment #0 from Leandro Lucarella <> 2010-08-15 16:56:49 
PDT ---
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[1] 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
the stack.

[*] 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:
------- You are receiving this mail because: -------

Reply via email to