This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch ld]: Do some memory cleanup for def-file parsing
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: Binutils <binutils at sourceware dot org>
- Cc: Alan Modra <amodra at gmail dot com>, Nick Clifton <nickc at redhat dot com>
- Date: Mon, 18 Apr 2011 13:17:22 +0200
- Subject: Re: [patch ld]: Do some memory cleanup for def-file parsing
- References: <BANLkTikpV82nGCm8cHPJPJ82H8PMdHQ2OQ@mail.gmail.com>
Ups, missed to add Nick in CC
2011/4/16 Kai Tietz <ktietz70@googlemail.com>:
> Hello,
>
> This patch does some memory optiomiations for def-file parsing. As
> this scanner is also used for directives, it can likely happen for big
> projects that here a lot of memory gets wasted, which additional
> leaked as nobody is releasing it again.
> This patch tries to minimize the amount of memory used here.
>
> ChangeLog ld/
>
> 2011-04-16 ?Kai Tietz
>
> ? ? ? ?* deffilep.y (def_pool_str): New type.
> ? ? ? ?(pool_strs): Local static.
> ? ? ? ?(def_pool_alloc): Local function.
> ? ? ? ?(def_pool_strdup): Likewise.
> ? ? ? ?(def_pool_free): Likewise.
> ? ? ? ?(opt_name): Replace xmalloc/xstrdup by
> ? ? ? ?def_pool_alloc/def_pool_strdup.
> ? ? ? ?(dot_name): Likewise.
> ? ? ? ?(anylang_id): Likewise.
> ? ? ? ?(def_lex): Likewise.
> ? ? ? ?(def_file_parse): Call def_pool_free on
> ? ? ? ?exit and cleanup directives elements.
> ? ? ? ?(def_file_add_directive): Call def_pool_free.
>
> Tested for x86_64-w64-mingw32, i686-w64-mingw32, and i686-pc-cygwin.
> Ok for apply?
>
> Regards,
> Kai
>
--
|? (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination