[llvm] r208007 - [Support/MemoryBuffer] Introduce a boolean parameter (false by default) 'IsVolatile' for the open file functions.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon May 5 16:21:35 PDT 2014


> -  if (shouldUseMmap(FD, FileSize, MapSize, Offset, RequiresNullTerminator,
> +  if (!IsVolatile &&
> +      shouldUseMmap(FD, FileSize, MapSize, Offset, RequiresNullTerminator,
>                      PageSize)) {

Why not put this in shouldUseMmap itself?

A more serious concern is that the semantics are pretty fuzzy. What
exactly does it mean to change often? If we are at risk of reading
modified data by using mmap, how do we guarantee that we don't read
modified data with read? Is the caller required to hold a lock when
doing the call? If so, that should be a comment saying so.

What is the intended use case for this?

Cheers,
Rafael



More information about the llvm-commits mailing list