TYPE_NAME memory management

Paul Pluzhnikov ppluzhnikov@google.com
Wed Sep 9 17:30:00 GMT 2009


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



More information about the Gdb mailing list