diff options
author | Tom Tromey <tom@tromey.com> | 2020-09-17 11:47:50 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-09-17 11:58:56 -0600 |
commit | 6108fd1823f9cf036bbbe528ffcdf2fee489b40a (patch) | |
tree | 0be755427c836f6981902a0a49b5b84f0f36f4dc /gdb/guile | |
parent | fa9b11648c07ecb02a9c038304d646a5c652a5e7 (diff) | |
download | gdb-6108fd1823f9cf036bbbe528ffcdf2fee489b40a.zip gdb-6108fd1823f9cf036bbbe528ffcdf2fee489b40a.tar.gz gdb-6108fd1823f9cf036bbbe528ffcdf2fee489b40a.tar.bz2 |
Use htab_up in type copying
This changes create_copied_types_hash to return an htab_up, then
modifies the callers to avoid explicit use of htab_delete.
gdb/ChangeLog
2020-09-17 Tom Tromey <tom@tromey.com>
* value.c (preserve_values): Update.
* python/py-type.c (save_objfile_types): Update.
* guile/scm-type.c (save_objfile_types): Update.
* gdbtypes.h (create_copied_types_hash): Return htab_up.
* gdbtypes.c (create_copied_types_hash): Return htab_up.
* compile/compile-object-run.c (compile_object_run): Update.
Diffstat (limited to 'gdb/guile')
-rw-r--r-- | gdb/guile/scm-type.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/gdb/guile/scm-type.c b/gdb/guile/scm-type.c index 19b7996..8fc9629 100644 --- a/gdb/guile/scm-type.c +++ b/gdb/guile/scm-type.c @@ -387,20 +387,17 @@ static void save_objfile_types (struct objfile *objfile, void *datum) { htab_t htab = (htab_t) datum; - htab_t copied_types; if (!gdb_scheme_initialized) return; - copied_types = create_copied_types_hash (objfile); + htab_up copied_types = create_copied_types_hash (objfile); if (htab != NULL) { - htab_traverse_noresize (htab, tyscm_copy_type_recursive, copied_types); + htab_traverse_noresize (htab, tyscm_copy_type_recursive, copied_types.get ()); htab_delete (htab); } - - htab_delete (copied_types); } /* Administrivia for field smobs. */ |