two questions (issues?) about phobos/std/mmfile.d
mw
mingwu at gmail.com
Fri Oct 14 00:57:52 UTC 2022
On Friday, 14 October 2022 at 00:30:55 UTC, mw wrote:
> 2) in ensureMapped() why the requested mmap length are 3x
> window (2x is enough, since the start offset of the mmap must
> be multiples of pagesize):
...
> https://github.com/dlang/phobos/blob/master/std/mmfile.d#L582
>
> ```
>
> map(window*(iblock-1),cast(size_t)(window*(jblock-iblock+3)));
> // should this be?:
> map(window*(iblock),
> cast(size_t)(window*(jblock-iblock+2)));
>
> ```
>
> So the mapped buffer size is consistent of 2x window?
and in ensureMapped(ulong i, ulong j),
enforce(j - i <= window)?
otherwise, what's the point of allowing user pass in `window` in
the ctor, if it's not honored?
More information about the Digitalmars-d
mailing list