This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: [rfc] FREEIF -> xfree()


Andrew Cagney wrote:
> 
> Continuing the move to xfree().
> Comments?
> 

That is what we decided to do, as far as I remember.

Fernando


>         Andrew
> 
>                                                   ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> Thu Jan 18 12:25:06 2001  Andrew Cagney  <cagney@b1.cygnus.com>
> 
>         * varobj.c (FREEIF): Delete macro.
>         (varobj_set_value, free_variable): Replace FREEIF with ``xfree''
>         call.
> 
> Index: varobj.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/varobj.c,v
> retrieving revision 1.14
> diff -p -r1.14 varobj.c
> *** varobj.c    2000/12/15 01:01:51     1.14
> --- varobj.c    2001/01/18 01:27:58
> *************** static int rootcount = 0;       /* number of r
> *** 391,401 ****
>   /* Pointer to the varobj hash table (built at run time) */
>   static struct vlist **varobj_table;
> 
> - #if defined(FREEIF)
> - #undef FREEIF
> - #endif
> - #define FREEIF(x) if (x != NULL) free((char *) (x))
> -
>   /* Is the variable X one of our "fake" children? */
>   #define CPLUS_FAKE_CHILD(x) \
>   ((x) != NULL && (x)->type == NULL && (x)->value == NULL)
> --- 391,396 ----
> *************** varobj_set_value (struct varobj *var, ch
> *** 788,794 ****
>         if (!gdb_evaluate_expression (exp, &value))
>         {
>           /* We cannot proceed without a valid expression. */
> !         FREEIF (exp);
>           return 0;
>         }
> 
> --- 783,789 ----
>         if (!gdb_evaluate_expression (exp, &value))
>         {
>           /* We cannot proceed without a valid expression. */
> !         xfree (exp);
>           return 0;
>         }
> 
> *************** free_variable (struct varobj *var)
> *** 1353,1364 ****
>     if (var->root->rootvar == var)
>       {
>         free_current_contents ((char **) &var->root->exp);
> !       FREEIF (var->root);
>       }
> 
> !   FREEIF (var->name);
> !   FREEIF (var->obj_name);
> !   FREEIF (var);
>   }
> 
>   static void
> --- 1348,1359 ----
>     if (var->root->rootvar == var)
>       {
>         free_current_contents ((char **) &var->root->exp);
> !       xfree (var->root);
>       }
> 
> !   xfree (var->name);
> !   xfree (var->obj_name);
> !   xfree (var);
>   }
> 
>   static void

-- 
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

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