Coverage Report

Created: 2025-06-13 06:55

/usr/include/glib-2.0/glib/glib-autocleanups.h
Line
Count
Source
1
/*
2
 * Copyright © 2015 Canonical Limited
3
 *
4
 * SPDX-License-Identifier: LGPL-2.1-or-later
5
 *
6
 * This library is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU Lesser General Public
8
 * License as published by the Free Software Foundation; either
9
 * version 2.1 of the License, or (at your option) any later version.
10
 *
11
 * This library is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 * Lesser General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public
17
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18
 *
19
 * Author: Ryan Lortie <desrt@desrt.ca>
20
 */
21
22
#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
23
#error "Only <glib.h> can be included directly."
24
#endif
25
26
static inline void
27
g_autoptr_cleanup_generic_gfree (void *p)
28
48.5k
{
29
48.5k
  void **pp = (void**)p;
30
48.5k
  g_free (*pp);
31
48.5k
}
Unexecuted instantiation: fuzz-repo.c:g_autoptr_cleanup_generic_gfree
glnx-dirfd.c:g_autoptr_cleanup_generic_gfree
Line
Count
Source
28
2.53k
{
29
2.53k
  void **pp = (void**)p;
30
2.53k
  g_free (*pp);
31
2.53k
}
Unexecuted instantiation: glnx-shutil.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: glnx-errors.c:g_autoptr_cleanup_generic_gfree
ostree-repo.c:g_autoptr_cleanup_generic_gfree
Line
Count
Source
28
16.0k
{
29
16.0k
  void **pp = (void**)p;
30
16.0k
  g_free (*pp);
31
16.0k
}
Unexecuted instantiation: ostree-repo-commit.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-repo-composefs.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-repo-pull.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-repo-refs.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-repo-verity.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-repo-file.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-repo-file-enumerator.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-sepolicy.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-sysroot.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-sysroot-cleanup.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-sysroot-deploy.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-bootconfig-parser.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-deployment.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-bootloader.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-bootloader-aboot.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-bootloader-grub2.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-bootloader-zipl.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-bootloader-syslinux.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-bootloader-uboot.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-repo-static-delta-core.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-repo-static-delta-processing.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-kernel-args.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-gpg-verifier.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-gpg-verify-result.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-sign.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-sign-dummy.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-blob-reader-raw.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ot-checksum-instream.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ot-checksum-utils.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ot-fs-utils.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ot-gio-utils.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ot-gpg-utils.c:g_autoptr_cleanup_generic_gfree
ot-keyfile-utils.c:g_autoptr_cleanup_generic_gfree
Line
Count
Source
28
16.3k
{
29
16.3k
  void **pp = (void**)p;
30
16.3k
  g_free (*pp);
31
16.3k
}
Unexecuted instantiation: ot-tool-util.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ot-unix-utils.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ot-variant-utils.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: otcore-prepare-root.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: glnx-console.c:g_autoptr_cleanup_generic_gfree
glnx-fdio.c:g_autoptr_cleanup_generic_gfree
Line
Count
Source
28
6.76k
{
29
6.76k
  void **pp = (void**)p;
30
6.76k
  g_free (*pp);
31
6.76k
}
Unexecuted instantiation: glnx-lockfile.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: glnx-xattrs.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-async-progress.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-core.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-checksum-input-stream.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-chain-input-stream.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-content-writer.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-lzma-decompressor.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-varint.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-linuxfsutil.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-diff.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-mutable-tree.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-ref.c:g_autoptr_cleanup_generic_gfree
ostree-remote.c:g_autoptr_cleanup_generic_gfree
Line
Count
Source
28
3.41k
{
29
3.41k
  void **pp = (void**)p;
30
3.41k
  g_free (*pp);
31
3.41k
}
Unexecuted instantiation: ostree-repo-checkout.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-repo-prune.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-repo-traverse.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-blob-reader.c:g_autoptr_cleanup_generic_gfree
Unexecuted instantiation: ostree-lzma-common.c:g_autoptr_cleanup_generic_gfree
fuzz-bsdiff.c:g_autoptr_cleanup_generic_gfree
Line
Count
Source
28
3.47k
{
29
3.47k
  void **pp = (void**)p;
30
3.47k
  g_free (*pp);
31
3.47k
}
32
33
static inline void
34
g_autoptr_cleanup_gstring_free (GString *string)
35
845
{
36
845
  if (string)
37
845
    g_string_free (string, TRUE);
38
845
}
Unexecuted instantiation: fuzz-repo.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: glnx-dirfd.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: glnx-shutil.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: glnx-errors.c:g_autoptr_cleanup_gstring_free
ostree-repo.c:g_autoptr_cleanup_gstring_free
Line
Count
Source
35
845
{
36
845
  if (string)
37
845
    g_string_free (string, TRUE);
38
845
}
Unexecuted instantiation: ostree-repo-commit.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-repo-composefs.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-repo-pull.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-repo-refs.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-repo-verity.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-repo-file.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-repo-file-enumerator.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-sepolicy.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-sysroot.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-sysroot-cleanup.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-sysroot-deploy.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-bootconfig-parser.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-deployment.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-bootloader.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-bootloader-aboot.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-bootloader-grub2.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-bootloader-zipl.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-bootloader-syslinux.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-bootloader-uboot.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-repo-static-delta-core.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-repo-static-delta-processing.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-kernel-args.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-gpg-verifier.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-gpg-verify-result.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-sign.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-sign-dummy.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-blob-reader-raw.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ot-checksum-instream.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ot-checksum-utils.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ot-fs-utils.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ot-gio-utils.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ot-gpg-utils.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ot-keyfile-utils.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ot-tool-util.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ot-unix-utils.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ot-variant-utils.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: otcore-prepare-root.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: glnx-console.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: glnx-fdio.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: glnx-lockfile.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: glnx-xattrs.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-async-progress.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-core.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-checksum-input-stream.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-chain-input-stream.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-content-writer.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-lzma-decompressor.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-varint.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-linuxfsutil.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-diff.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-mutable-tree.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-ref.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-remote.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-repo-checkout.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-repo-prune.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-repo-traverse.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-blob-reader.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: ostree-lzma-common.c:g_autoptr_cleanup_gstring_free
Unexecuted instantiation: fuzz-bsdiff.c:g_autoptr_cleanup_gstring_free
39
40
/* Ignore deprecations in case we refer to a type which was added in a more
41
 * recent GLib version than the user’s #GLIB_VERSION_MAX_ALLOWED definition. */
42
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
43
44
/* If adding a cleanup here, please also add a test case to
45
 * glib/tests/autoptr.c
46
 */
47
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GAsyncQueue, g_async_queue_unref)
48
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GBookmarkFile, g_bookmark_file_free)
49
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GBytes, g_bytes_unref)
50
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GChecksum, g_checksum_free)
51
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDateTime, g_date_time_unref)
52
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDate, g_date_free)
53
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GDir, g_dir_close)
54
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GError, g_error_free)
55
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GHashTable, g_hash_table_unref)
56
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GHmac, g_hmac_unref)
57
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GIOChannel, g_io_channel_unref)
58
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GKeyFile, g_key_file_unref)
59
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GList, g_list_free)
60
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GArray, g_array_unref)
61
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GPtrArray, g_ptr_array_unref)
62
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GByteArray, g_byte_array_unref)
63
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMainContext, g_main_context_unref)
64
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMainContextPusher, g_main_context_pusher_free)
65
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMainLoop, g_main_loop_unref)
66
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSource, g_source_unref)
67
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMappedFile, g_mapped_file_unref)
68
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMarkupParseContext, g_markup_parse_context_unref)
69
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GNode, g_node_destroy)
70
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GOptionContext, g_option_context_free)
71
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GOptionGroup, g_option_group_unref)
72
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GPatternSpec, g_pattern_spec_free)
73
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GQueue, g_queue_free)
74
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GQueue, g_queue_clear)
75
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRand, g_rand_free)
76
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRegex, g_regex_unref)
77
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMatchInfo, g_match_info_unref)
78
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GScanner, g_scanner_destroy)
79
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSequence, g_sequence_free)
80
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSList, g_slist_free)
81
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GString, g_autoptr_cleanup_gstring_free)
82
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GStringChunk, g_string_chunk_free)
83
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GStrvBuilder, g_strv_builder_unref)
84
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GThread, g_thread_unref)
85
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GMutex, g_mutex_clear)
86
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMutexLocker, g_mutex_locker_free)
87
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRecMutexLocker, g_rec_mutex_locker_free)
88
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRWLockWriterLocker, g_rw_lock_writer_locker_free)
89
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRWLockReaderLocker, g_rw_lock_reader_locker_free)
90
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GCond, g_cond_clear)
91
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTimer, g_timer_destroy)
92
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTimeZone, g_time_zone_unref)
93
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTree, g_tree_unref)
94
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariant, g_variant_unref)
95
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantBuilder, g_variant_builder_unref)
96
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GVariantBuilder, g_variant_builder_clear)
97
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantIter, g_variant_iter_free)
98
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantDict, g_variant_dict_unref)
99
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GVariantDict, g_variant_dict_clear)
100
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantType, g_variant_type_free)
101
G_DEFINE_AUTO_CLEANUP_FREE_FUNC(GStrv, g_strfreev, NULL)
102
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRefString, g_ref_string_release)
103
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUri, g_uri_unref)
104
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GPathBuf, g_path_buf_free)
105
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (GPathBuf, g_path_buf_clear)
106
107
G_GNUC_END_IGNORE_DEPRECATIONS