This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] removing aged ifdef 0 from boehm-gc/os_dep.c


This is my first effort at contributing to gcc, so I thought I would try
with some of the easy stuff listed here:
https://gcc.gnu.org/projects/beginner.html

Attached is a patch removing a block which has been #if 0'd out since
2006.  I tested the build afterward.

I look forward to your feedback.

Glen Stark
From 479aade4f9120f200bf77f027d9f4fce34b56b5c Mon Sep 17 00:00:00 2001
From: Glen Stark <mail@glenstark.net>
Date: Sat, 9 Apr 2016 22:05:03 +0200
Subject: [PATCH] Removed stale # if 0 statement

---
 boehm-gc/os_dep.c | 33 ---------------------------------
 1 file changed, 33 deletions(-)

diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c
index 2b22c9d..caff82e 100644
--- a/boehm-gc/os_dep.c
+++ b/boehm-gc/os_dep.c
@@ -1566,38 +1566,6 @@ void GC_register_data_segments()
 #   define SBRK_ARG_T int
 # endif
 
-
-# if 0 && defined(RS6000)  /* We now use mmap */
-/* The compiler seems to generate speculative reads one past the end of	*/
-/* an allocated object.  Hence we need to make sure that the page 	*/
-/* following the last heap page is also mapped.				*/
-ptr_t GC_unix_get_mem(bytes)
-word bytes;
-{
-    caddr_t cur_brk = (caddr_t)sbrk(0);
-    caddr_t result;
-    SBRK_ARG_T lsbs = (word)cur_brk & (GC_page_size-1);
-    static caddr_t my_brk_val = 0;
-
-    if ((SBRK_ARG_T)bytes < 0) return(0); /* too big */
-    if (lsbs != 0) {
-        if((caddr_t)(sbrk(GC_page_size - lsbs)) == (caddr_t)(-1)) return(0);
-    }
-    if (cur_brk == my_brk_val) {
-    	/* Use the extra block we allocated last time. */
-        result = (ptr_t)sbrk((SBRK_ARG_T)bytes);
-        if (result == (caddr_t)(-1)) return(0);
-        result -= GC_page_size;
-    } else {
-        result = (ptr_t)sbrk(GC_page_size + (SBRK_ARG_T)bytes);
-        if (result == (caddr_t)(-1)) return(0);
-    }
-    my_brk_val = result + bytes + GC_page_size;	/* Always page aligned */
-    return((ptr_t)result);
-}
-
-#else  /* Not RS6000 */
-
 #if defined(USE_MMAP) || defined(USE_MUNMAP)
 
 #ifdef USE_MMAP_FIXED
@@ -1694,7 +1662,6 @@ word bytes;
 }
 
 #endif /* Not USE_MMAP */
-#endif /* Not RS6000 */
 
 # endif /* UN*X */
 
-- 
2.5.5

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]