GC: two major pain point the compiler/druntime can help with

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Tue May 21 12:34:34 UTC 2024


On 22/05/2024 12:07 AM, deadalnix wrote:
>  1. Static data that contain pointer or not are not differentiated.
> 
> The compiler put all the static data in 2 segments, depending on whether 
> they are zero initialized or not. Then these segment are passed down to 
> the GC to scan. Any application that has large buffer of static data, 
> for instance precomputed result to speedup computations, ends up 
> scanning them again and again for pointers.
> 
> The compiler knows what static data may or may not contain pointers, and 
> could split them up in different segment, and the runtime could only 
> pass down the appropriate segment. This is an almost free win.

Does this also apply to immutable typed data?


More information about the Digitalmars-d mailing list