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]

Re: [PATCH] Cleanup some remains from the obstack days.


Op zo 06-04-2003, om 16:56 schreef Steven Bosscher:
> This seemed like a nice cleanup.  Deletes ~120 lines.

I should of course attach the correct patch...

> Index: bitmap.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/bitmap.c,v
> retrieving revision 1.40
> diff -c -3 -p -r1.40 bitmap.c
> *** bitmap.c	25 Jan 2003 18:21:22 -0000	1.40
> --- bitmap.c	6 Apr 2003 14:36:44 -0000
> *************** bitmap_element_allocate (head)
> *** 125,153 ****
>   	  if (!bitmap_obstack_init)
>   	    {
>   	      bitmap_obstack_init = TRUE;
> ! 	      
> ! 	      /* Let particular systems override the size of a chunk.  */
> ! #ifndef OBSTACK_CHUNK_SIZE
> ! #define OBSTACK_CHUNK_SIZE 0
> ! #endif
> ! 	      /* Let them override the alloc and free routines too.  */
> ! #ifndef OBSTACK_CHUNK_ALLOC
> ! #define OBSTACK_CHUNK_ALLOC xmalloc
> ! #endif
> ! #ifndef OBSTACK_CHUNK_FREE
> ! #define OBSTACK_CHUNK_FREE free
> ! #endif
> ! 	      
>   #if !defined(__GNUC__) || (__GNUC__ < 2)
>   #define __alignof__(type) 0
>   #endif
> ! 	      
> ! 	      obstack_specify_allocation (&bitmap_obstack, OBSTACK_CHUNK_SIZE,
>   					  __alignof__ (bitmap_element),
> ! 					  (void *(*) PARAMS ((long))) OBSTACK_CHUNK_ALLOC,
> ! 					  (void (*) PARAMS ((void *))) OBSTACK_CHUNK_FREE);
>   	    }
> ! 	  
>   	  element = (bitmap_element *) obstack_alloc (&bitmap_obstack,
>   						      sizeof (bitmap_element));
>   	}
> --- 125,141 ----
>   	  if (!bitmap_obstack_init)
>   	    {
>   	      bitmap_obstack_init = TRUE;
> ! 
>   #if !defined(__GNUC__) || (__GNUC__ < 2)
>   #define __alignof__(type) 0
>   #endif
> ! 
> ! 	      obstack_specify_allocation (&bitmap_obstack, 0,
							   ^
read "OBSTACK_CHUNK_SIZE" instead of "0" there.

>   					  __alignof__ (bitmap_element),
> ! 					  obstack_chunk_alloc,
> ! 					  obstack_chunk_free);
>   	    }
> ! 
>   	  element = (bitmap_element *) obstack_alloc (&bitmap_obstack,
>   						      sizeof (bitmap_element));
>   	}




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