Date: Sun, 11 Aug 2019 12:55:00 -0700
On Sun, Aug 11, 2019 at 12:51 PM Lyberta via SG15 <sg15_at_[hidden]>
wrote:
> David Blaikie:
> > My understanding is the OS does this itself - if you memory map a file
> > read-only, it can share memory pages with other processes that are also
> > doing that?
>
> Ah, so build system memory maps the BMI and then hopes that OS will do
> the right thing? Unfortunately, we can't do that within realm of ISO C++
> yet and I want to keep the build system I'm writing within ISO C++ as
> much as possible (I use Networking TS for sockets).
>
Oh, no, the build system doesn't do anything here other than tell the
compiler the path to the BMI - the compiler does the memory mapping - given
a path to the BMI, the compiler doesn't read the bytes with a stream - it
memory maps the file directly, so it can lazily load/reference components
of the file. Clang's BMI consists of efficient on-disk hash tables and
things, so only the necessary portions of a BMI are ever read (always room
for improvement, all software has bugs, etc - but that's the general goal).
>
> _______________________________________________
> SG15 mailing list
> SG15_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/sg15
>
wrote:
> David Blaikie:
> > My understanding is the OS does this itself - if you memory map a file
> > read-only, it can share memory pages with other processes that are also
> > doing that?
>
> Ah, so build system memory maps the BMI and then hopes that OS will do
> the right thing? Unfortunately, we can't do that within realm of ISO C++
> yet and I want to keep the build system I'm writing within ISO C++ as
> much as possible (I use Networking TS for sockets).
>
Oh, no, the build system doesn't do anything here other than tell the
compiler the path to the BMI - the compiler does the memory mapping - given
a path to the BMI, the compiler doesn't read the bytes with a stream - it
memory maps the file directly, so it can lazily load/reference components
of the file. Clang's BMI consists of efficient on-disk hash tables and
things, so only the necessary portions of a BMI are ever read (always room
for improvement, all software has bugs, etc - but that's the general goal).
>
> _______________________________________________
> SG15 mailing list
> SG15_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/sg15
>
Received on 2019-08-11 14:57:11