Update documentation of function copy_type_recursive

Message ID 1440887631-23069-1-git-send-email-patrick@parcs.ath.cx
State New, archived
Headers

Commit Message

Patrick Palka Aug. 29, 2015, 10:33 p.m. UTC
  Following commit 8f57eec2fb3 ("Use gdbarch obstack to allocate types in
alloc_type_arch") it is no longer the case that the type returned by
copy_type_recursive is allocated using malloc.  Because the function
uses alloc_type_arch internally, the new type is now allocated on the
gdbarch associated with the type, and is thus owned by that gdbarch.

gdb/ChangeLog:

	* gdbtypes.c (copy_type_recursive): Update documentation.
---
 gdb/gdbtypes.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Doug Evans Sept. 2, 2015, 5:05 a.m. UTC | #1
Patrick Palka <patrick@parcs.ath.cx> writes:
> Following commit 8f57eec2fb3 ("Use gdbarch obstack to allocate types in
> alloc_type_arch") it is no longer the case that the type returned by
> copy_type_recursive is allocated using malloc.  Because the function
> uses alloc_type_arch internally, the new type is now allocated on the
> gdbarch associated with the type, and is thus owned by that gdbarch.
>
> gdb/ChangeLog:
>
> 	* gdbtypes.c (copy_type_recursive): Update documentation.
> ---
>  gdb/gdbtypes.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
> index 8204d39..7a18bed 100644
> --- a/gdb/gdbtypes.c
> +++ b/gdb/gdbtypes.c
> @@ -4356,9 +4356,9 @@ copy_dynamic_prop_list (struct obstack *objfile_obstack,
>  }
>  
>  /* Recursively copy (deep copy) TYPE, if it is associated with
> -   OBJFILE.  Return a new type allocated using malloc, a saved type if
> -   we have already visited TYPE (using COPIED_TYPES), or TYPE if it is
> -   not associated with OBJFILE.  */
> +   OBJFILE.  Return a new type owned by the gdbarch associated with the type, a
> +   saved type if we have already visited TYPE (using COPIED_TYPES), or TYPE if
> +   it is not associated with OBJFILE.  */
>  
>  struct type *
>  copy_type_recursive (struct objfile *objfile, 

LGTM.
Thanks!
  

Patch

diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 8204d39..7a18bed 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -4356,9 +4356,9 @@  copy_dynamic_prop_list (struct obstack *objfile_obstack,
 }
 
 /* Recursively copy (deep copy) TYPE, if it is associated with
-   OBJFILE.  Return a new type allocated using malloc, a saved type if
-   we have already visited TYPE (using COPIED_TYPES), or TYPE if it is
-   not associated with OBJFILE.  */
+   OBJFILE.  Return a new type owned by the gdbarch associated with the type, a
+   saved type if we have already visited TYPE (using COPIED_TYPES), or TYPE if
+   it is not associated with OBJFILE.  */
 
 struct type *
 copy_type_recursive (struct objfile *objfile,