This is the mail archive of the gdb@sourceware.org mailing list for the GDB 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: TYPE_NAME memory management


On Wed, Sep 9, 2009 at 9:40 AM, Doug Evans<dje@google.com> wrote:

> struct objfile_data
> {
>   unsigned index;
>   /* The objfile is about to be freed. ?Save anything needed from it. ?*/
>   void (*save) (struct objfile *, void *);
>   /* Free all objfile-related resources held. ?*/
>   void (*free) (struct objfile *, void *);
> };

How about s/save/cleanup/ and s/free/destroy/:

> It would require adding a parameter to
> register_objfile_data_with_cleanup and updating all the callers.

Perhaps a new 'register_objfile_data_with_cleanup_and_destroy' function
which register_objfile_data_with_cleanup can call with NULL as the destroy
parameter?

But then there are only 4 places which call it, so not a big deal to
update them all.

-- 
Paul Pluzhnikov


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