druntime's PAGESIZE

IGotD- nise at nise.com
Sat Oct 31 19:18:08 UTC 2020


On Saturday, 31 October 2020 at 19:06:33 UTC, Denis Feklushkin 
wrote:
> Hi!
>
> Looks like some of these values are redundant:
>
> src/rt/lifetime.d
> 31:        PAGESIZE = 4096,
>
> src/gc/pooltable.d
> 181:    enum PAGESIZE = 4096;
>
> src/gc/impl/conservative/gc.d
> 1133:{   PAGESIZE =    4096,
>
> This is correct? Which ones are related to each other? Which 
> ones can be freely changed so that nothing (silently) breaks?
>
> On a small system these values ​​seems too high.

Yes, this is particular bad and also this should OS configurable 
(there might be an OS that suddenly bumps the page size to let's 
say 16KB) and not part of the D memory management code but part 
of the OS specific configuration.

Another problem for small systems is that the GC seems to assume 
page aligned memory, typically received from mmap or 
VirtualAlloc, however on small system and using the malloc 
fallback this doesn't work well. This waste memory on small 
system.

This should be fixed.



More information about the Digitalmars-d mailing list