diff options
author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-16 18:17:53 +0000 |
---|---|---|
committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-16 18:17:53 +0000 |
commit | e42c948205f06cb09858930c0b9f975618173b4b (patch) | |
tree | 26c20fa606fd521d3651d948dc560efd2618ea87 /gcc/cppfiles.c | |
parent | daad55a5fee70e2e8743ead5a95c20faead82727 (diff) | |
download | ppe42-gcc-e42c948205f06cb09858930c0b9f975618173b4b.tar.gz ppe42-gcc-e42c948205f06cb09858930c0b9f975618173b4b.zip |
* cppfiles.c (purge_cache): use munmap() only if MMAP_THRESHOLD
defined.
(read_include_file): Ensure inc->mmaped is initialized.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36459 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppfiles.c')
-rw-r--r-- | gcc/cppfiles.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c index 6b99b616e06..ffb46d26b1f 100644 --- a/gcc/cppfiles.c +++ b/gcc/cppfiles.c @@ -272,6 +272,7 @@ read_include_file (pfile, inc) } size = inc->st.st_size; + inc->mapped = 0; #if MMAP_THRESHOLD if (pagesize == -1) pagesize = getpagesize (); @@ -300,7 +301,6 @@ read_include_file (pfile, inc) } offset += count; } - inc->mapped = 0; } } else if (S_ISBLK (inc->st.st_mode)) @@ -363,9 +363,11 @@ purge_cache (inc) { if (inc->buffer) { +#if MMAP_THRESHOLD if (inc->mapped) munmap ((PTR) inc->buffer, inc->st.st_size); else +#endif free ((PTR) inc->buffer); inc->buffer = NULL; } |