From 084163dc0438b896339b4617663294854f30e371 Mon Sep 17 00:00:00 2001 From: neil Date: Wed, 26 Sep 2001 21:44:35 +0000 Subject: * cpphash.h (struct cpp_pool): Remove locks and locked. (struct cpp_context): Add member buff. (struct cpp_reader): Remove member argument_pool. (_cpp_lock_pool, _cpp_unlock_pool): Remove. * cppinit.c (cpp_create_reader, cpp_destroy): Argument_pool is dead. * cpplex.c (chunk_suitable): Remove pool argument. (MIN_BUFF_SIZE, BUFF_SIZE_UPPER_BOUND, EXTENDED_BUFF_SIZE): New. (new_buff, _cpp_extend_buff): Update. (_cpp_get_buff): Fix silly pointer bug. Be more selective about which buffer is returned. (_cpp_next_chunk, _cpp_init_pool): Pool locking removed. (_cpp_lock_pool, _cpp_unlock_pool): Remove. * cppmacro.c (lock_pools, unlock_pools): Remove. (push_ptoken_context): Take a _cpp_buff. (enter_macro_context): Pool locking removed. (replace_args): Use a _cpp_buff for the replacement list with arguments replaced. (push_token_context): Clear buff. (expand_arg): Use _cpp_pop_context. (_cpp_pop_context): Free a context's buffer, if any. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45833 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cpphash.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gcc/cpphash.h') diff --git a/gcc/cpphash.h b/gcc/cpphash.h index ee5b03e624a..58ae27f0e5f 100644 --- a/gcc/cpphash.h +++ b/gcc/cpphash.h @@ -66,10 +66,9 @@ struct cpp_chunk typedef struct cpp_pool cpp_pool; struct cpp_pool { - struct cpp_chunk *cur, *locked, *first; + struct cpp_chunk *cur, *first; unsigned char *pos; /* Current position. */ unsigned int align; - unsigned int locks; }; /* A generic memory buffer. */ @@ -134,6 +133,10 @@ struct cpp_context union utoken first; union utoken last; + /* If non-NULL, a buffer used for storage related to this context. + When the context is popped, the buffer is freed. */ + _cpp_buff *buff; + /* For a macro context, these are the macro and its arguments. */ cpp_macro *macro; @@ -267,7 +270,6 @@ struct cpp_reader cpp_pool ident_pool; /* For all identifiers, and permanent numbers and strings. */ cpp_pool macro_pool; /* For macro definitions. Permanent. */ - cpp_pool argument_pool; /* For macro arguments. Temporary. */ /* Memory buffers. */ _cpp_buff *free_buffs; @@ -436,8 +438,6 @@ extern unsigned char *_cpp_pool_reserve PARAMS ((cpp_pool *, unsigned int)); extern unsigned char *_cpp_pool_alloc PARAMS ((cpp_pool *, unsigned int)); extern unsigned char *_cpp_next_chunk PARAMS ((cpp_pool *, unsigned int, unsigned char **)); -extern void _cpp_lock_pool PARAMS ((cpp_pool *)); -extern void _cpp_unlock_pool PARAMS ((cpp_pool *)); /* In cppinit.c. */ extern bool _cpp_push_next_buffer PARAMS ((cpp_reader *)); -- cgit v1.2.1