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]

Re: PATCH: better cpplex.c patch


  In message <ms4s40c4m4.fsf@mcgary.org>you write:
  > Jeffrey A Law <law@cygnus.com> writes:
  > 
  > >   In message <msn1hvod19.fsf@mcgary.org>you write:
  > >   > > Or are we indeed resizing items within the realloc'd buffer too?
  > >   > 
  > >   > Yes, we are--at least for now.
  > > OK.  I missed that.  Sigh.  How gross.
  > 
  > Here's a patch that sets bounds on the token strings allocated from a
  > token-list namebuf, and expands the bounds of only the token for which
  > we're expanding the namebuf.  In all other places, token text is
  > allocated via single calls to malloc or strdup which return the
  > properly bounded pointer.  We only need special handling for these
  > token list beasties because they allocate out of a single contiguous
  > buffer.
  > 
  > Zack, what's the rationale for tokenlists allocating from a single
  > buffer?  Does this save significant time because you can free a token
  > list all at once?  Is the savings still enough when you account for
  > the cost of realloc'ing and relocating token pointers?
  > 
  > 2000-09-01  Greg McGary  <greg@mcgary.org>
  > 
  > 	* cpplex.c (bounded-ptr.h): New include.
  > 	(_cpp_expand_name_space): Also relocate bounds of token pointers.
  > 	(parse_number, parse_string, save_comment): Set bounds
  > 	of newly minted token.
Did the bounded-ptr.h patch ever get approved/installed?  This patch is
fine once the patch which introduces bounded-ptr.h patch has been installed.

If the bounded-ptr.h patch hasn't been installed, could you please repost it?

Thanks,
jeff


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