aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Love2000-09-08 16:31:11 +0000
committerDave Love2000-09-08 16:31:11 +0000
commitd93c318653b590403d1541a3e38bc460dbedf754 (patch)
treec7750672bd1bc0c8b475976e269217c07ef212ed /src
parent1932bc86eb4e67438c3753d2d371fef00f6be2f2 (diff)
downloademacs-d93c318653b590403d1541a3e38bc460dbedf754.tar.gz
emacs-d93c318653b590403d1541a3e38bc460dbedf754.zip
(r_alloc_init_fd): Move. Fix conditional for pcc.
Diffstat (limited to 'src')
-rw-r--r--src/ralloc.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/ralloc.c b/src/ralloc.c
index 6ef6a1f0cd1..23ff1dcb930 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -1317,18 +1317,7 @@ static struct mmap_region *mmap_find P_ ((POINTER_TYPE *, POINTER_TYPE *));
1317POINTER_TYPE *r_alloc P_ ((POINTER_TYPE **, size_t)); 1317POINTER_TYPE *r_alloc P_ ((POINTER_TYPE **, size_t));
1318POINTER_TYPE *r_re_alloc P_ ((POINTER_TYPE **, size_t)); 1318POINTER_TYPE *r_re_alloc P_ ((POINTER_TYPE **, size_t));
1319void r_alloc_free P_ ((POINTER_TYPE **ptr)); 1319void r_alloc_free P_ ((POINTER_TYPE **ptr));
1320 1320void r_alloc_init_fd ();
1321
1322void
1323r_alloc_init_fd ()
1324{
1325#if !MAP_ANON
1326 /* No anonymous mmap -- we need the file descriptor. */
1327 mmap_fd = open ("/dev/zero", O_RDONLY);
1328 if (mmap_fd < 0)
1329 fatal ("cannot open /dev/zero");
1330#endif
1331}
1332 1321
1333/* Return a region overlapping address range START...END, or null if 1322/* Return a region overlapping address range START...END, or null if
1334 none. END is not including, i.e. the last byte in the range 1323 none. END is not including, i.e. the last byte in the range
@@ -1667,6 +1656,21 @@ r_alloc_free (var)
1667extern POINTER (*__morecore) (); 1656extern POINTER (*__morecore) ();
1668#endif 1657#endif
1669 1658
1659/* Set up the file descriptor for non-anonymous mmapping. */
1660
1661void
1662r_alloc_init_fd ()
1663{
1664#ifdef REL_ALLOC_MMAP
1665#if !MAP_ANON
1666 /* No anonymous mmap -- we need the file descriptor. */
1667 mmap_fd = open ("/dev/zero", O_RDONLY);
1668 if (mmap_fd < 0)
1669 fatal ("cannot open /dev/zero");
1670#endif
1671#endif
1672}
1673
1670/* Initialize various things for memory allocation. */ 1674/* Initialize various things for memory allocation. */
1671 1675
1672static void 1676static void