Request for comments: std.d.lexer

Dmitry Olshansky dmitry.olsh at gmail.com
Sun Feb 3 01:22:46 PST 2013


03-Feb-2013 05:30, Walter Bright пишет:
> On 2/2/2013 1:54 PM, Dmitry Olshansky wrote:
>> I think I failed to describe the virtual memory trick or you just
>> ignored it?
>
> You can't just reserve 1Gb of address space in a 32 bit system. (I know
> about reserving address space vs committing memory.)
>

OK, sorry you must knew this stuff throughly.  1Gb is not the point I 
feel like I shouldn't been listing 1Gb at all as we need much less.
It's about 21 Mb of D source code in full dmd test suite + druntime + 
phobos, and only 4M in vibe.d including all examples. Reserve this amount.

It's the same amount of memory as in read them all and slice them all 
approach that is said to be so fast and practical. And yet we don't 
commit this RAM at all most of the time.

Thinking more of 32bit systems that are so tight on address space - it's 
2Gb for user-mode. Precisely because of that a signed 32 bit offset is 
enough to address RAM if we store it in multiple chunks like you said. 
The fact that there is only 2Gb of user-space actually sort of helps us 
as we surely can reach the other chunks from a single base.

In case of 3Gb (some linux-es and/or large address aware win32) we just 
need to reserve the first range somewhere in the middle, as we do it at 
startup this should be easy with a few probes.

Also after the lexing you can always free the address space and 
reallocate-compact it as the last step like I said earlier.


-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list