diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-01 03:49:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-01 03:49:38 +0000 |
commit | 8ffa1ff5cb3934feffa90e656f2ccc3b3795e411 (patch) | |
tree | e806b13ec353ddcce39a37d3cfcda3bb8f43ba63 /include | |
parent | 35aa79df510c0cf9ad37ec63377daaa351030772 (diff) | |
download | external_llvm-8ffa1ff5cb3934feffa90e656f2ccc3b3795e411.zip external_llvm-8ffa1ff5cb3934feffa90e656f2ccc3b3795e411.tar.gz external_llvm-8ffa1ff5cb3934feffa90e656f2ccc3b3795e411.tar.bz2 |
Make MappedFile::map return a const correct pointer, don't leak address space on Unix platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49026 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/System/MappedFile.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/llvm/System/MappedFile.h b/include/llvm/System/MappedFile.h index c46491e..127c04f 100644 --- a/include/llvm/System/MappedFile.h +++ b/include/llvm/System/MappedFile.h @@ -65,15 +65,13 @@ namespace sys { return initialize(ErrMsg); } - /// unmap - Remove the mapped file from memory. If the file was mapped for - /// write access, the memory contents will be automatically synchronized - /// with the file's disk contents. + /// unmap - Remove the mapped file from memory. void unmap(); /// map - Reserve space for the file, map it into memory, and return a /// pointer to it. This returns the base memory address of the mapped file /// or 0 if an error occurred. - void *map(std::string* ErrMsg = 0); + const void *map(std::string* ErrMsg = 0); void close() { if (MapInfo) terminate(); } |