[dmd-internals] Giving better static data limits to the GC

Martin Nowak dawg at dawgfoto.de
Wed Feb 1 13:58:57 PST 2012


On Wed, 01 Feb 2012 22:37:50 +0100, Walter Bright <walter at digitalmars.com>  
wrote:

>
>
> On 8/23/2010 5:32 AM, Leandro Lucarella wrote:
>> That's why I think the pointer bitmasks generation should be added to
>> DMD, it doesn't affect the runtime, unless you explicitly use that
>> information, it doesn't mean you have to provide a precise scanning GC
>> by default.
>>
>
> 1. I think your idea of grouping static data that doesn't need to be  
> scanned separately from static data that does is a good one. It means  
> putting them into a different 'segment' in the object file, analogously  
> to the way moduleinfo and eh tables are emitted into different segments.
>
You can't obtain sections for ELF files (only whole segments), so we'd
have to use that clamping trick again. For shared libraries if used all
writeable/allocated segments (there is usually only one). So the best
way to save here is to move things into .rodata where possible.

The heap is usually orders of magnitude bigger than the static data,
so it probably won't matter that much.


More information about the dmd-internals mailing list