[LLVMbugs] [Bug 19868] New: MemoryBuffer could probably use mmap, even when copying the buffer.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 27 07:38:51 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19868

            Bug ID: 19868
           Summary: MemoryBuffer could probably use mmap, even when
                    copying the buffer.
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Support Libraries
          Assignee: unassignedbugs at nondot.org
          Reporter: rafael.espindola at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Right now the logic is somewhat like

if (shouldUseMmap(...))
  useMmap;
else
  read loop

We could probably do

mmap the file
if (shouldUseMmap)
  return a MemoryBuffer using the mmap.
else
   memcopy and unmap the mapped file

This would have the advantage of avoiding the read loop and would also allow us
to pass the buffer to shoulduseMmmap which could then check if the last byte is
0 or not. That would let us gracefully fall back to copying the buffer on
broken file systems.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140527/8e65cfd3/attachment.html>


More information about the llvm-bugs mailing list