summaryrefslogtreecommitdiffstats
path: root/gcc/cppfiles.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-16 18:17:53 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-16 18:17:53 +0000
commite42c948205f06cb09858930c0b9f975618173b4b (patch)
tree26c20fa606fd521d3651d948dc560efd2618ea87 /gcc/cppfiles.c
parentdaad55a5fee70e2e8743ead5a95c20faead82727 (diff)
downloadppe42-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.c4
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;
}
OpenPOWER on IntegriCloud