* hash.c (hash_new_sized): Make it global.
	* hash.h: Declare it.
	* macro.c (define_macro): Use hash_new_sized instead of hash_new,
	pass a small size.
This commit is contained in:
Roland McGrath 2013-01-10 17:11:17 +00:00
parent 861ea9c877
commit 4c665b71b1
4 changed files with 24 additions and 16 deletions

View File

@ -1,3 +1,10 @@
2013-01-10 Roland McGrath <mcgrathr@google.com>
* hash.c (hash_new_sized): Make it global.
* hash.h: Declare it.
* macro.c (define_macro): Use hash_new_sized instead of hash_new,
pass a small size.
2013-01-10 Will Newton <will.newton@imgtec.com>
* Makefile.am: Add Meta.

View File

@ -1,6 +1,6 @@
/* hash.c -- gas hash table code
Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
2000, 2001, 2002, 2003, 2005, 2007, 2008, 2009, 2011
2000, 2001, 2002, 2003, 2005, 2007, 2008, 2009, 2011, 2013
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -83,7 +83,7 @@ set_gas_hash_table_size (unsigned long size)
/* Create a hash table. This return a control block. */
static struct hash_control *
struct hash_control *
hash_new_sized (unsigned long size)
{
unsigned long alloc;

View File

@ -1,5 +1,5 @@
/* hash.h -- header file for gas hash table routines
Copyright 1987, 1992, 1993, 1995, 1999, 2003, 2005, 2007, 2008
Copyright 1987, 1992, 1993, 1995, 1999, 2003, 2005, 2007, 2008, 2013
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@ -31,6 +31,7 @@ void set_gas_hash_table_size (unsigned long);
/* Create a hash table. This return a control block. */
extern struct hash_control *hash_new (void);
extern struct hash_control *hash_new_sized (unsigned long);
/* Delete a hash table, freeing all allocated memory. */

View File

@ -1,6 +1,6 @@
/* macro.c - macro support for gas
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2008, 2011, 2012 Free Software Foundation, Inc.
2004, 2005, 2006, 2007, 2008, 2011, 2012, 2013 Free Software Foundation, Inc.
Written by Steve and Judy Chamberlain of Cygnus Support,
sac@cygnus.com
@ -642,7 +642,7 @@ define_macro (size_t idx, sb *in, sb *label,
macro->formal_count = 0;
macro->formals = 0;
macro->formal_hash = hash_new ();
macro->formal_hash = hash_new_sized (7);
idx = sb_skip_white (idx, in);
if (! buffer_and_nest ("MACRO", "ENDM", &macro->sub, get_line))