/work/include/glib-2.0/glib/gmem.h
Line | Count | Source |
1 | | /* GLIB - Library of useful routines for C programming |
2 | | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald |
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 | | |
20 | | /* |
21 | | * Modified by the GLib Team and others 1997-2000. See the AUTHORS |
22 | | * file for a list of people on the GLib Team. See the ChangeLog |
23 | | * files for a list of changes. These files are distributed with |
24 | | * GLib at ftp://ftp.gtk.org/pub/gtk/. |
25 | | */ |
26 | | |
27 | | #ifndef __G_MEM_H__ |
28 | | #define __G_MEM_H__ |
29 | | |
30 | | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) |
31 | | #error "Only <glib.h> can be included directly." |
32 | | #endif |
33 | | |
34 | | #include <glib/gutils.h> |
35 | | #include <glib/glib-typeof.h> |
36 | | |
37 | | G_BEGIN_DECLS |
38 | | |
39 | | /** |
40 | | * GMemVTable: |
41 | | * @malloc: function to use for allocating memory. |
42 | | * @realloc: function to use for reallocating memory. |
43 | | * @free: function to use to free memory. |
44 | | * @calloc: function to use for allocating zero-filled memory. |
45 | | * @try_malloc: function to use for allocating memory without a default error handler. |
46 | | * @try_realloc: function to use for reallocating memory without a default error handler. |
47 | | * |
48 | | * A set of functions used to perform memory allocation. The same #GMemVTable must |
49 | | * be used for all allocations in the same program; a call to g_mem_set_vtable(), |
50 | | * if it exists, should be prior to any use of GLib. |
51 | | * |
52 | | * This functions related to this has been deprecated in 2.46, and no longer work. |
53 | | */ |
54 | | typedef struct _GMemVTable GMemVTable; |
55 | | |
56 | | |
57 | | #if GLIB_SIZEOF_VOID_P > GLIB_SIZEOF_LONG |
58 | | /** |
59 | | * G_MEM_ALIGN: |
60 | | * |
61 | | * Indicates the number of bytes to which memory will be aligned on the |
62 | | * current platform. |
63 | | */ |
64 | | # define G_MEM_ALIGN GLIB_SIZEOF_VOID_P |
65 | | #else /* GLIB_SIZEOF_VOID_P <= GLIB_SIZEOF_LONG */ |
66 | | # define G_MEM_ALIGN GLIB_SIZEOF_LONG |
67 | | #endif /* GLIB_SIZEOF_VOID_P <= GLIB_SIZEOF_LONG */ |
68 | | |
69 | | |
70 | | /* Memory allocation functions |
71 | | */ |
72 | | |
73 | | GLIB_AVAILABLE_IN_ALL |
74 | | void (g_free) (gpointer mem); |
75 | | GLIB_AVAILABLE_IN_2_76 |
76 | | void g_free_sized (gpointer mem, |
77 | | size_t size); |
78 | | |
79 | | GLIB_AVAILABLE_IN_2_34 |
80 | | void g_clear_pointer (gpointer *pp, |
81 | | GDestroyNotify destroy); |
82 | | |
83 | | GLIB_AVAILABLE_IN_ALL |
84 | | gpointer g_malloc (gsize n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1); |
85 | | GLIB_AVAILABLE_IN_ALL |
86 | | gpointer g_malloc0 (gsize n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1); |
87 | | GLIB_AVAILABLE_IN_ALL |
88 | | gpointer g_realloc (gpointer mem, |
89 | | gsize n_bytes) G_GNUC_WARN_UNUSED_RESULT; |
90 | | GLIB_AVAILABLE_IN_ALL |
91 | | gpointer g_try_malloc (gsize n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1); |
92 | | GLIB_AVAILABLE_IN_ALL |
93 | | gpointer g_try_malloc0 (gsize n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1); |
94 | | GLIB_AVAILABLE_IN_ALL |
95 | | gpointer g_try_realloc (gpointer mem, |
96 | | gsize n_bytes) G_GNUC_WARN_UNUSED_RESULT; |
97 | | |
98 | | GLIB_AVAILABLE_IN_ALL |
99 | | gpointer g_malloc_n (gsize n_blocks, |
100 | | gsize n_block_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE2(1,2); |
101 | | GLIB_AVAILABLE_IN_ALL |
102 | | gpointer g_malloc0_n (gsize n_blocks, |
103 | | gsize n_block_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE2(1,2); |
104 | | GLIB_AVAILABLE_IN_ALL |
105 | | gpointer g_realloc_n (gpointer mem, |
106 | | gsize n_blocks, |
107 | | gsize n_block_bytes) G_GNUC_WARN_UNUSED_RESULT; |
108 | | GLIB_AVAILABLE_IN_ALL |
109 | | gpointer g_try_malloc_n (gsize n_blocks, |
110 | | gsize n_block_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE2(1,2); |
111 | | GLIB_AVAILABLE_IN_ALL |
112 | | gpointer g_try_malloc0_n (gsize n_blocks, |
113 | | gsize n_block_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE2(1,2); |
114 | | GLIB_AVAILABLE_IN_ALL |
115 | | gpointer g_try_realloc_n (gpointer mem, |
116 | | gsize n_blocks, |
117 | | gsize n_block_bytes) G_GNUC_WARN_UNUSED_RESULT; |
118 | | |
119 | | GLIB_AVAILABLE_IN_2_72 |
120 | | gpointer g_aligned_alloc (gsize n_blocks, |
121 | | gsize n_block_bytes, |
122 | | gsize alignment) G_GNUC_WARN_UNUSED_RESULT G_GNUC_ALLOC_SIZE2(1,2); |
123 | | GLIB_AVAILABLE_IN_2_72 |
124 | | gpointer g_aligned_alloc0 (gsize n_blocks, |
125 | | gsize n_block_bytes, |
126 | | gsize alignment) G_GNUC_WARN_UNUSED_RESULT G_GNUC_ALLOC_SIZE2(1,2); |
127 | | GLIB_AVAILABLE_IN_2_72 |
128 | | void g_aligned_free (gpointer mem); |
129 | | GLIB_AVAILABLE_IN_2_76 |
130 | | void g_aligned_free_sized (gpointer mem, |
131 | | size_t alignment, |
132 | | size_t size); |
133 | | |
134 | | #if defined(glib_typeof) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_58 |
135 | | #define g_clear_pointer(pp, destroy) \ |
136 | 8.13M | G_STMT_START \ |
137 | 8.13M | { \ |
138 | 8.13M | G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer)); \ |
139 | 8.13M | glib_typeof ((pp)) _pp = (pp); \ |
140 | 8.13M | glib_typeof (*(pp)) _ptr = *_pp; \ |
141 | 8.13M | *_pp = NULL; \ |
142 | 8.13M | if (_ptr) \ |
143 | 8.13M | (destroy) (_ptr); \ |
144 | 8.13M | } \ |
145 | 8.13M | G_STMT_END \ |
146 | 1.79M | GLIB_AVAILABLE_MACRO_IN_2_34 |
147 | | #else /* __GNUC__ */ |
148 | | #define g_clear_pointer(pp, destroy) \ |
149 | | G_STMT_START { \ |
150 | | G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer)); \ |
151 | | /* Only one access, please; work around type aliasing */ \ |
152 | | union { char *in; gpointer *out; } _pp; \ |
153 | | gpointer _p; \ |
154 | | /* This assignment is needed to avoid a gcc warning */ \ |
155 | | GDestroyNotify _destroy = (GDestroyNotify) (destroy); \ |
156 | | \ |
157 | | _pp.in = (char *) (pp); \ |
158 | | _p = *_pp.out; \ |
159 | | if (_p) \ |
160 | | { \ |
161 | | *_pp.out = NULL; \ |
162 | | _destroy (_p); \ |
163 | | } \ |
164 | | } G_STMT_END \ |
165 | | GLIB_AVAILABLE_MACRO_IN_2_34 |
166 | | #endif /* __GNUC__ */ |
167 | | |
168 | | |
169 | | #if G_GNUC_CHECK_VERSION (4, 1) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_78 && defined(G_HAVE_FREE_SIZED) |
170 | | |
171 | | #define g_free(mem) \ |
172 | | (__builtin_object_size ((mem), 0) != ((size_t) - 1)) ? \ |
173 | | g_free_sized (mem, __builtin_object_size ((mem), 0)) : (g_free) (mem) |
174 | | |
175 | | #endif /* G_GNUC_CHECK_VERSION (4, 1) && && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_78 && defined(G_HAVE_FREE_SIZED) */ |
176 | | |
177 | | /** |
178 | | * g_steal_pointer: |
179 | | * @pp: (not nullable): a pointer to a pointer |
180 | | * |
181 | | * Sets @pp to %NULL, returning the value that was there before. |
182 | | * |
183 | | * Conceptually, this transfers the ownership of the pointer from the |
184 | | * referenced variable to the "caller" of the macro (ie: "steals" the |
185 | | * reference). |
186 | | * |
187 | | * The return value will be properly typed, according to the type of |
188 | | * @pp. |
189 | | * |
190 | | * This can be very useful when combined with g_autoptr() to prevent the |
191 | | * return value of a function from being automatically freed. Consider |
192 | | * the following example (which only works on GCC and clang): |
193 | | * |
194 | | * |[ |
195 | | * GObject * |
196 | | * create_object (void) |
197 | | * { |
198 | | * g_autoptr(GObject) obj = g_object_new (G_TYPE_OBJECT, NULL); |
199 | | * |
200 | | * if (early_error_case) |
201 | | * return NULL; |
202 | | * |
203 | | * return g_steal_pointer (&obj); |
204 | | * } |
205 | | * ]| |
206 | | * |
207 | | * It can also be used in similar ways for 'out' parameters and is |
208 | | * particularly useful for dealing with optional out parameters: |
209 | | * |
210 | | * |[ |
211 | | * gboolean |
212 | | * get_object (GObject **obj_out) |
213 | | * { |
214 | | * g_autoptr(GObject) obj = g_object_new (G_TYPE_OBJECT, NULL); |
215 | | * |
216 | | * if (early_error_case) |
217 | | * return FALSE; |
218 | | * |
219 | | * if (obj_out) |
220 | | * *obj_out = g_steal_pointer (&obj); |
221 | | * |
222 | | * return TRUE; |
223 | | * } |
224 | | * ]| |
225 | | * |
226 | | * In the above example, the object will be automatically freed in the |
227 | | * early error case and also in the case that %NULL was given for |
228 | | * @obj_out. |
229 | | * |
230 | | * Since: 2.44 |
231 | | */ |
232 | | GLIB_AVAILABLE_STATIC_INLINE_IN_2_44 |
233 | | static inline gpointer |
234 | | g_steal_pointer (gpointer pp) |
235 | 31.7M | { |
236 | 31.7M | gpointer *ptr = (gpointer *) pp; |
237 | 31.7M | gpointer ref; |
238 | | |
239 | 31.7M | ref = *ptr; |
240 | 31.7M | *ptr = NULL; |
241 | | |
242 | 31.7M | return ref; |
243 | 31.7M | } fu-synaptics-cape-struct.c:g_steal_pointer Line | Count | Source | 235 | 103 | { | 236 | 103 | gpointer *ptr = (gpointer *) pp; | 237 | 103 | gpointer ref; | 238 | | | 239 | 103 | ref = *ptr; | 240 | 103 | *ptr = NULL; | 241 | | | 242 | 103 | return ref; | 243 | 103 | } |
Unexecuted instantiation: fu-synaptics-cape-firmware.c:g_steal_pointer fu-synaptics-cape-hid-firmware.c:g_steal_pointer Line | Count | Source | 235 | 103 | { | 236 | 103 | gpointer *ptr = (gpointer *) pp; | 237 | 103 | gpointer ref; | 238 | | | 239 | 103 | ref = *ptr; | 240 | 103 | *ptr = NULL; | 241 | | | 242 | 103 | return ref; | 243 | 103 | } |
Unexecuted instantiation: fu-synaptics-cape-sngl-firmware.c:g_steal_pointer Unexecuted instantiation: fwupd-bios-setting-struct.c:g_steal_pointer Unexecuted instantiation: fwupd-client-struct.c:g_steal_pointer Unexecuted instantiation: fwupd-codec-struct.c:g_steal_pointer Unexecuted instantiation: fwupd-device-struct.c:g_steal_pointer Unexecuted instantiation: fwupd-enums-struct.c:g_steal_pointer Unexecuted instantiation: fwupd-error-struct.c:g_steal_pointer Unexecuted instantiation: fwupd-jcat-struct.c:g_steal_pointer Unexecuted instantiation: fwupd-json-struct.c:g_steal_pointer Unexecuted instantiation: fwupd-plugin-struct.c:g_steal_pointer Unexecuted instantiation: fwupd-release-struct.c:g_steal_pointer Unexecuted instantiation: fwupd-remote-struct.c:g_steal_pointer Unexecuted instantiation: fwupd-report-struct.c:g_steal_pointer Unexecuted instantiation: fwupd-request-struct.c:g_steal_pointer Unexecuted instantiation: fwupd-security-attr-struct.c:g_steal_pointer Unexecuted instantiation: fwupd-common.c:g_steal_pointer Unexecuted instantiation: fwupd-codec.c:g_steal_pointer Unexecuted instantiation: fwupd-device.c:g_steal_pointer Unexecuted instantiation: fwupd-error.c:g_steal_pointer Unexecuted instantiation: fwupd-bios-setting.c:g_steal_pointer Unexecuted instantiation: fwupd-jcat-blob.c:g_steal_pointer Unexecuted instantiation: fwupd-jcat-file.c:g_steal_pointer Unexecuted instantiation: fwupd-jcat-item.c:g_steal_pointer Unexecuted instantiation: fwupd-json-array.c:g_steal_pointer Unexecuted instantiation: fwupd-json-common.c:g_steal_pointer Unexecuted instantiation: fwupd-json-node.c:g_steal_pointer Unexecuted instantiation: fwupd-json-object.c:g_steal_pointer Unexecuted instantiation: fwupd-json-parser.c:g_steal_pointer Unexecuted instantiation: fwupd-security-attr.c:g_steal_pointer Unexecuted instantiation: fwupd-release.c:g_steal_pointer Unexecuted instantiation: fwupd-report.c:g_steal_pointer Unexecuted instantiation: fwupd-request.c:g_steal_pointer Unexecuted instantiation: fwupd-variant.c:g_steal_pointer Unexecuted instantiation: fu-cbor-struct.c:g_steal_pointer Unexecuted instantiation: fu-crc-struct.c:g_steal_pointer Unexecuted instantiation: fu-progress-struct.c:g_steal_pointer Unexecuted instantiation: fu-common-struct.c:g_steal_pointer fu-acpi-table-struct.c:g_steal_pointer Line | Count | Source | 235 | 2.02k | { | 236 | 2.02k | gpointer *ptr = (gpointer *) pp; | 237 | 2.02k | gpointer ref; | 238 | | | 239 | 2.02k | ref = *ptr; | 240 | 2.02k | *ptr = NULL; | 241 | | | 242 | 2.02k | return ref; | 243 | 2.02k | } |
fu-cab-struct.c:g_steal_pointer Line | Count | Source | 235 | 287k | { | 236 | 287k | gpointer *ptr = (gpointer *) pp; | 237 | 287k | gpointer ref; | 238 | | | 239 | 287k | ref = *ptr; | 240 | 287k | *ptr = NULL; | 241 | | | 242 | 287k | return ref; | 243 | 287k | } |
Unexecuted instantiation: fu-cfi-struct.c:g_steal_pointer Unexecuted instantiation: fu-cfu-struct.c:g_steal_pointer fu-cfu-firmware-struct.c:g_steal_pointer Line | Count | Source | 235 | 642k | { | 236 | 642k | gpointer *ptr = (gpointer *) pp; | 237 | 642k | gpointer ref; | 238 | | | 239 | 642k | ref = *ptr; | 240 | 642k | *ptr = NULL; | 241 | | | 242 | 642k | return ref; | 243 | 642k | } |
Unexecuted instantiation: fu-config-struct.c:g_steal_pointer Unexecuted instantiation: fu-coswid-struct.c:g_steal_pointer Unexecuted instantiation: fu-context-struct.c:g_steal_pointer Unexecuted instantiation: fu-device-struct.c:g_steal_pointer fu-dfu-firmware-struct.c:g_steal_pointer Line | Count | Source | 235 | 2.23k | { | 236 | 2.23k | gpointer *ptr = (gpointer *) pp; | 237 | 2.23k | gpointer ref; | 238 | | | 239 | 2.23k | ref = *ptr; | 240 | 2.23k | *ptr = NULL; | 241 | | | 242 | 2.23k | return ref; | 243 | 2.23k | } |
Unexecuted instantiation: fu-dpaux-struct.c:g_steal_pointer Unexecuted instantiation: fu-dump-struct.c:g_steal_pointer fu-edid-struct.c:g_steal_pointer Line | Count | Source | 235 | 1.01k | { | 236 | 1.01k | gpointer *ptr = (gpointer *) pp; | 237 | 1.01k | gpointer ref; | 238 | | | 239 | 1.01k | ref = *ptr; | 240 | 1.01k | *ptr = NULL; | 241 | | | 242 | 1.01k | return ref; | 243 | 1.01k | } |
fu-efi-struct.c:g_steal_pointer Line | Count | Source | 235 | 1.18M | { | 236 | 1.18M | gpointer *ptr = (gpointer *) pp; | 237 | 1.18M | gpointer ref; | 238 | | | 239 | 1.18M | ref = *ptr; | 240 | 1.18M | *ptr = NULL; | 241 | | | 242 | 1.18M | return ref; | 243 | 1.18M | } |
fu-elf-struct.c:g_steal_pointer Line | Count | Source | 235 | 4.59M | { | 236 | 4.59M | gpointer *ptr = (gpointer *) pp; | 237 | 4.59M | gpointer ref; | 238 | | | 239 | 4.59M | ref = *ptr; | 240 | 4.59M | *ptr = NULL; | 241 | | | 242 | 4.59M | return ref; | 243 | 4.59M | } |
fu-fdt-struct.c:g_steal_pointer Line | Count | Source | 235 | 88.3k | { | 236 | 88.3k | gpointer *ptr = (gpointer *) pp; | 237 | 88.3k | gpointer ref; | 238 | | | 239 | 88.3k | ref = *ptr; | 240 | 88.3k | *ptr = NULL; | 241 | | | 242 | 88.3k | return ref; | 243 | 88.3k | } |
Unexecuted instantiation: fu-firmware-struct.c:g_steal_pointer fu-fmap-struct.c:g_steal_pointer Line | Count | Source | 235 | 142k | { | 236 | 142k | gpointer *ptr = (gpointer *) pp; | 237 | 142k | gpointer ref; | 238 | | | 239 | 142k | ref = *ptr; | 240 | 142k | *ptr = NULL; | 241 | | | 242 | 142k | return ref; | 243 | 142k | } |
Unexecuted instantiation: fu-hid-struct.c:g_steal_pointer fu-ifd-struct.c:g_steal_pointer Line | Count | Source | 235 | 3.73k | { | 236 | 3.73k | gpointer *ptr = (gpointer *) pp; | 237 | 3.73k | gpointer ref; | 238 | | | 239 | 3.73k | ref = *ptr; | 240 | 3.73k | *ptr = NULL; | 241 | | | 242 | 3.73k | return ref; | 243 | 3.73k | } |
fu-ifwi-struct.c:g_steal_pointer Line | Count | Source | 235 | 47.0k | { | 236 | 47.0k | gpointer *ptr = (gpointer *) pp; | 237 | 47.0k | gpointer ref; | 238 | | | 239 | 47.0k | ref = *ptr; | 240 | 47.0k | *ptr = NULL; | 241 | | | 242 | 47.0k | return ref; | 243 | 47.0k | } |
Unexecuted instantiation: fu-ihex-struct.c:g_steal_pointer Unexecuted instantiation: fu-intel-me-struct.c:g_steal_pointer Unexecuted instantiation: fu-intel-thunderbolt-struct.c:g_steal_pointer Unexecuted instantiation: fu-io-channel-struct.c:g_steal_pointer Unexecuted instantiation: fu-ioctl-struct.c:g_steal_pointer Unexecuted instantiation: fu-heci-struct.c:g_steal_pointer Unexecuted instantiation: fu-msgpack-struct.c:g_steal_pointer fu-oprom-struct.c:g_steal_pointer Line | Count | Source | 235 | 1.60k | { | 236 | 1.60k | gpointer *ptr = (gpointer *) pp; | 237 | 1.60k | gpointer ref; | 238 | | | 239 | 1.60k | ref = *ptr; | 240 | 1.60k | *ptr = NULL; | 241 | | | 242 | 1.60k | return ref; | 243 | 1.60k | } |
Unexecuted instantiation: fu-path-struct.c:g_steal_pointer fu-pefile-struct.c:g_steal_pointer Line | Count | Source | 235 | 15.7k | { | 236 | 15.7k | gpointer *ptr = (gpointer *) pp; | 237 | 15.7k | gpointer ref; | 238 | | | 239 | 15.7k | ref = *ptr; | 240 | 15.7k | *ptr = NULL; | 241 | | | 242 | 15.7k | return ref; | 243 | 15.7k | } |
Unexecuted instantiation: fu-pci-struct.c:g_steal_pointer Unexecuted instantiation: fu-processor-struct.c:g_steal_pointer Unexecuted instantiation: fu-protobuf-struct.c:g_steal_pointer fu-sbatlevel-section-struct.c:g_steal_pointer Line | Count | Source | 235 | 73 | { | 236 | 73 | gpointer *ptr = (gpointer *) pp; | 237 | 73 | gpointer ref; | 238 | | | 239 | 73 | ref = *ptr; | 240 | 73 | *ptr = NULL; | 241 | | | 242 | 73 | return ref; | 243 | 73 | } |
Unexecuted instantiation: fu-security-attrs-struct.c:g_steal_pointer Unexecuted instantiation: fu-smbios-struct.c:g_steal_pointer Unexecuted instantiation: fu-srec-struct.c:g_steal_pointer fu-tpm-struct.c:g_steal_pointer Line | Count | Source | 235 | 646k | { | 236 | 646k | gpointer *ptr = (gpointer *) pp; | 237 | 646k | gpointer ref; | 238 | | | 239 | 646k | ref = *ptr; | 240 | 646k | *ptr = NULL; | 241 | | | 242 | 646k | return ref; | 243 | 646k | } |
Unexecuted instantiation: fu-usb-device-ds20-struct.c:g_steal_pointer fu-usb-struct.c:g_steal_pointer Line | Count | Source | 235 | 872k | { | 236 | 872k | gpointer *ptr = (gpointer *) pp; | 237 | 872k | gpointer ref; | 238 | | | 239 | 872k | ref = *ptr; | 240 | 872k | *ptr = NULL; | 241 | | | 242 | 872k | return ref; | 243 | 872k | } |
fu-uswid-struct.c:g_steal_pointer Line | Count | Source | 235 | 65.2k | { | 236 | 65.2k | gpointer *ptr = (gpointer *) pp; | 237 | 65.2k | gpointer ref; | 238 | | | 239 | 65.2k | ref = *ptr; | 240 | 65.2k | *ptr = NULL; | 241 | | | 242 | 65.2k | return ref; | 243 | 65.2k | } |
Unexecuted instantiation: fu-v4l-struct.c:g_steal_pointer fu-zip-struct.c:g_steal_pointer Line | Count | Source | 235 | 56.8k | { | 236 | 56.8k | gpointer *ptr = (gpointer *) pp; | 237 | 56.8k | gpointer ref; | 238 | | | 239 | 56.8k | ref = *ptr; | 240 | 56.8k | *ptr = NULL; | 241 | | | 242 | 56.8k | return ref; | 243 | 56.8k | } |
fu-acpi-table.c:g_steal_pointer Line | Count | Source | 235 | 123 | { | 236 | 123 | gpointer *ptr = (gpointer *) pp; | 237 | 123 | gpointer ref; | 238 | | | 239 | 123 | ref = *ptr; | 240 | 123 | *ptr = NULL; | 241 | | | 242 | 123 | return ref; | 243 | 123 | } |
Unexecuted instantiation: fu-backend.c:g_steal_pointer Unexecuted instantiation: fu-bios-setting.c:g_steal_pointer Unexecuted instantiation: fu-byte-array.c:g_steal_pointer Unexecuted instantiation: fu-bytes.c:g_steal_pointer fu-cab-firmware.c:g_steal_pointer Line | Count | Source | 235 | 6.09k | { | 236 | 6.09k | gpointer *ptr = (gpointer *) pp; | 237 | 6.09k | gpointer ref; | 238 | | | 239 | 6.09k | ref = *ptr; | 240 | 6.09k | *ptr = NULL; | 241 | | | 242 | 6.09k | return ref; | 243 | 6.09k | } |
Unexecuted instantiation: fu-cab-image.c:g_steal_pointer fu-cbor-item.c:g_steal_pointer Line | Count | Source | 235 | 359k | { | 236 | 359k | gpointer *ptr = (gpointer *) pp; | 237 | 359k | gpointer ref; | 238 | | | 239 | 359k | ref = *ptr; | 240 | 359k | *ptr = NULL; | 241 | | | 242 | 359k | return ref; | 243 | 359k | } |
fu-cbor-common.c:g_steal_pointer Line | Count | Source | 235 | 190k | { | 236 | 190k | gpointer *ptr = (gpointer *) pp; | 237 | 190k | gpointer ref; | 238 | | | 239 | 190k | ref = *ptr; | 240 | 190k | *ptr = NULL; | 241 | | | 242 | 190k | return ref; | 243 | 190k | } |
fu-cfu-offer.c:g_steal_pointer Line | Count | Source | 235 | 40 | { | 236 | 40 | gpointer *ptr = (gpointer *) pp; | 237 | 40 | gpointer ref; | 238 | | | 239 | 40 | ref = *ptr; | 240 | 40 | *ptr = NULL; | 241 | | | 242 | 40 | return ref; | 243 | 40 | } |
fu-cfu-payload.c:g_steal_pointer Line | Count | Source | 235 | 340 | { | 236 | 340 | gpointer *ptr = (gpointer *) pp; | 237 | 340 | gpointer ref; | 238 | | | 239 | 340 | ref = *ptr; | 240 | 340 | *ptr = NULL; | 241 | | | 242 | 340 | return ref; | 243 | 340 | } |
Unexecuted instantiation: fu-chunk.c:g_steal_pointer fu-chunk-array.c:g_steal_pointer Line | Count | Source | 235 | 1.38M | { | 236 | 1.38M | gpointer *ptr = (gpointer *) pp; | 237 | 1.38M | gpointer ref; | 238 | | | 239 | 1.38M | ref = *ptr; | 240 | 1.38M | *ptr = NULL; | 241 | | | 242 | 1.38M | return ref; | 243 | 1.38M | } |
Unexecuted instantiation: fu-common.c:g_steal_pointer Unexecuted instantiation: fu-composite-input-stream.c:g_steal_pointer fu-compressor-stream.c:g_steal_pointer Line | Count | Source | 235 | 8.14k | { | 236 | 8.14k | gpointer *ptr = (gpointer *) pp; | 237 | 8.14k | gpointer ref; | 238 | | | 239 | 8.14k | ref = *ptr; | 240 | 8.14k | *ptr = NULL; | 241 | | | 242 | 8.14k | return ref; | 243 | 8.14k | } |
Unexecuted instantiation: fu-config.c:g_steal_pointer Unexecuted instantiation: fu-context.c:g_steal_pointer Unexecuted instantiation: fu-coswid-common.c:g_steal_pointer fu-coswid-firmware.c:g_steal_pointer Line | Count | Source | 235 | 14.3k | { | 236 | 14.3k | gpointer *ptr = (gpointer *) pp; | 237 | 14.3k | gpointer ref; | 238 | | | 239 | 14.3k | ref = *ptr; | 240 | 14.3k | *ptr = NULL; | 241 | | | 242 | 14.3k | return ref; | 243 | 14.3k | } |
Unexecuted instantiation: fu-crc.c:g_steal_pointer fu-csv-entry.c:g_steal_pointer Line | Count | Source | 235 | 171k | { | 236 | 171k | gpointer *ptr = (gpointer *) pp; | 237 | 171k | gpointer ref; | 238 | | | 239 | 171k | ref = *ptr; | 240 | 171k | *ptr = NULL; | 241 | | | 242 | 171k | return ref; | 243 | 171k | } |
fu-csv-firmware.c:g_steal_pointer Line | Count | Source | 235 | 2.77k | { | 236 | 2.77k | gpointer *ptr = (gpointer *) pp; | 237 | 2.77k | gpointer ref; | 238 | | | 239 | 2.77k | ref = *ptr; | 240 | 2.77k | *ptr = NULL; | 241 | | | 242 | 2.77k | return ref; | 243 | 2.77k | } |
Unexecuted instantiation: fu-device.c:g_steal_pointer Unexecuted instantiation: fu-device-event.c:g_steal_pointer Unexecuted instantiation: fu-device-locker.c:g_steal_pointer fu-dfu-firmware.c:g_steal_pointer Line | Count | Source | 235 | 128 | { | 236 | 128 | gpointer *ptr = (gpointer *) pp; | 237 | 128 | gpointer ref; | 238 | | | 239 | 128 | ref = *ptr; | 240 | 128 | *ptr = NULL; | 241 | | | 242 | 128 | return ref; | 243 | 128 | } |
fu-dfuse-firmware.c:g_steal_pointer Line | Count | Source | 235 | 1.33k | { | 236 | 1.33k | gpointer *ptr = (gpointer *) pp; | 237 | 1.33k | gpointer ref; | 238 | | | 239 | 1.33k | ref = *ptr; | 240 | 1.33k | *ptr = NULL; | 241 | | | 242 | 1.33k | return ref; | 243 | 1.33k | } |
Unexecuted instantiation: fu-dummy-efivars.c:g_steal_pointer Unexecuted instantiation: fu-dump.c:g_steal_pointer fu-edid.c:g_steal_pointer Line | Count | Source | 235 | 410 | { | 236 | 410 | gpointer *ptr = (gpointer *) pp; | 237 | 410 | gpointer ref; | 238 | | | 239 | 410 | ref = *ptr; | 240 | 410 | *ptr = NULL; | 241 | | | 242 | 410 | return ref; | 243 | 410 | } |
Unexecuted instantiation: fu-efi-common.c:g_steal_pointer fu-efi-device-path.c:g_steal_pointer Line | Count | Source | 235 | 35.0k | { | 236 | 35.0k | gpointer *ptr = (gpointer *) pp; | 237 | 35.0k | gpointer ref; | 238 | | | 239 | 35.0k | ref = *ptr; | 240 | 35.0k | *ptr = NULL; | 241 | | | 242 | 35.0k | return ref; | 243 | 35.0k | } |
fu-efi-device-path-list.c:g_steal_pointer Line | Count | Source | 235 | 941 | { | 236 | 941 | gpointer *ptr = (gpointer *) pp; | 237 | 941 | gpointer ref; | 238 | | | 239 | 941 | ref = *ptr; | 240 | 941 | *ptr = NULL; | 241 | | | 242 | 941 | return ref; | 243 | 941 | } |
Unexecuted instantiation: fu-efi-file-path-device-path.c:g_steal_pointer fu-efi-file.c:g_steal_pointer Line | Count | Source | 235 | 6.96k | { | 236 | 6.96k | gpointer *ptr = (gpointer *) pp; | 237 | 6.96k | gpointer ref; | 238 | | | 239 | 6.96k | ref = *ptr; | 240 | 6.96k | *ptr = NULL; | 241 | | | 242 | 6.96k | return ref; | 243 | 6.96k | } |
fu-efi-filesystem.c:g_steal_pointer Line | Count | Source | 235 | 1.01k | { | 236 | 1.01k | gpointer *ptr = (gpointer *) pp; | 237 | 1.01k | gpointer ref; | 238 | | | 239 | 1.01k | ref = *ptr; | 240 | 1.01k | *ptr = NULL; | 241 | | | 242 | 1.01k | return ref; | 243 | 1.01k | } |
fu-efi-section.c:g_steal_pointer Line | Count | Source | 235 | 9.92k | { | 236 | 9.92k | gpointer *ptr = (gpointer *) pp; | 237 | 9.92k | gpointer ref; | 238 | | | 239 | 9.92k | ref = *ptr; | 240 | 9.92k | *ptr = NULL; | 241 | | | 242 | 9.92k | return ref; | 243 | 9.92k | } |
fu-efi-volume.c:g_steal_pointer Line | Count | Source | 235 | 4.44k | { | 236 | 4.44k | gpointer *ptr = (gpointer *) pp; | 237 | 4.44k | gpointer ref; | 238 | | | 239 | 4.44k | ref = *ptr; | 240 | 4.44k | *ptr = NULL; | 241 | | | 242 | 4.44k | return ref; | 243 | 4.44k | } |
fu-efi-lz77-decompressor.c:g_steal_pointer Line | Count | Source | 235 | 4.24k | { | 236 | 4.24k | gpointer *ptr = (gpointer *) pp; | 237 | 4.24k | gpointer ref; | 238 | | | 239 | 4.24k | ref = *ptr; | 240 | 4.24k | *ptr = NULL; | 241 | | | 242 | 4.24k | return ref; | 243 | 4.24k | } |
fu-efi-hard-drive-device-path.c:g_steal_pointer Line | Count | Source | 235 | 385 | { | 236 | 385 | gpointer *ptr = (gpointer *) pp; | 237 | 385 | gpointer ref; | 238 | | | 239 | 385 | ref = *ptr; | 240 | 385 | *ptr = NULL; | 241 | | | 242 | 385 | return ref; | 243 | 385 | } |
fu-efi-load-option.c:g_steal_pointer Line | Count | Source | 235 | 1.54k | { | 236 | 1.54k | gpointer *ptr = (gpointer *) pp; | 237 | 1.54k | gpointer ref; | 238 | | | 239 | 1.54k | ref = *ptr; | 240 | 1.54k | *ptr = NULL; | 241 | | | 242 | 1.54k | return ref; | 243 | 1.54k | } |
Unexecuted instantiation: fu-efi-signature.c:g_steal_pointer Unexecuted instantiation: fu-efi-signature-list.c:g_steal_pointer fu-efi-vss2-variable-store.c:g_steal_pointer Line | Count | Source | 235 | 477 | { | 236 | 477 | gpointer *ptr = (gpointer *) pp; | 237 | 477 | gpointer ref; | 238 | | | 239 | 477 | ref = *ptr; | 240 | 477 | *ptr = NULL; | 241 | | | 242 | 477 | return ref; | 243 | 477 | } |
fu-efi-vss-auth-variable.c:g_steal_pointer Line | Count | Source | 235 | 2.02k | { | 236 | 2.02k | gpointer *ptr = (gpointer *) pp; | 237 | 2.02k | gpointer ref; | 238 | | | 239 | 2.02k | ref = *ptr; | 240 | 2.02k | *ptr = NULL; | 241 | | | 242 | 2.02k | return ref; | 243 | 2.02k | } |
fu-efi-ftw-store.c:g_steal_pointer Line | Count | Source | 235 | 321 | { | 236 | 321 | gpointer *ptr = (gpointer *) pp; | 237 | 321 | gpointer ref; | 238 | | | 239 | 321 | ref = *ptr; | 240 | 321 | *ptr = NULL; | 241 | | | 242 | 321 | return ref; | 243 | 321 | } |
Unexecuted instantiation: fu-efivars.c:g_steal_pointer Unexecuted instantiation: fu-efi-x509-signature.c:g_steal_pointer fu-elf-firmware.c:g_steal_pointer Line | Count | Source | 235 | 1.01M | { | 236 | 1.01M | gpointer *ptr = (gpointer *) pp; | 237 | 1.01M | gpointer ref; | 238 | | | 239 | 1.01M | ref = *ptr; | 240 | 1.01M | *ptr = NULL; | 241 | | | 242 | 1.01M | return ref; | 243 | 1.01M | } |
fu-fdt-firmware.c:g_steal_pointer Line | Count | Source | 235 | 3.78k | { | 236 | 3.78k | gpointer *ptr = (gpointer *) pp; | 237 | 3.78k | gpointer ref; | 238 | | | 239 | 3.78k | ref = *ptr; | 240 | 3.78k | *ptr = NULL; | 241 | | | 242 | 3.78k | return ref; | 243 | 3.78k | } |
Unexecuted instantiation: fu-fdt-image.c:g_steal_pointer Unexecuted instantiation: fu-file-input-stream.c:g_steal_pointer fu-firmware.c:g_steal_pointer Line | Count | Source | 235 | 428k | { | 236 | 428k | gpointer *ptr = (gpointer *) pp; | 237 | 428k | gpointer ref; | 238 | | | 239 | 428k | ref = *ptr; | 240 | 428k | *ptr = NULL; | 241 | | | 242 | 428k | return ref; | 243 | 428k | } |
Unexecuted instantiation: fu-firmware-common.c:g_steal_pointer Unexecuted instantiation: fu-fit-firmware.c:g_steal_pointer fu-fmap-firmware.c:g_steal_pointer Line | Count | Source | 235 | 1.28k | { | 236 | 1.28k | gpointer *ptr = (gpointer *) pp; | 237 | 1.28k | gpointer ref; | 238 | | | 239 | 1.28k | ref = *ptr; | 240 | 1.28k | *ptr = NULL; | 241 | | | 242 | 1.28k | return ref; | 243 | 1.28k | } |
Unexecuted instantiation: fu-fuzzer.c:g_steal_pointer Unexecuted instantiation: fu-ginput-stream-adapter.c:g_steal_pointer fu-hid-descriptor.c:g_steal_pointer Line | Count | Source | 235 | 946 | { | 236 | 946 | gpointer *ptr = (gpointer *) pp; | 237 | 946 | gpointer ref; | 238 | | | 239 | 946 | ref = *ptr; | 240 | 946 | *ptr = NULL; | 241 | | | 242 | 946 | return ref; | 243 | 946 | } |
fu-hid-report-item.c:g_steal_pointer Line | Count | Source | 235 | 5.87k | { | 236 | 5.87k | gpointer *ptr = (gpointer *) pp; | 237 | 5.87k | gpointer ref; | 238 | | | 239 | 5.87k | ref = *ptr; | 240 | 5.87k | *ptr = NULL; | 241 | | | 242 | 5.87k | return ref; | 243 | 5.87k | } |
Unexecuted instantiation: fu-hid-report.c:g_steal_pointer Unexecuted instantiation: fu-hwids.c:g_steal_pointer Unexecuted instantiation: fu-hwids-config.c:g_steal_pointer Unexecuted instantiation: fu-hwids-dmi.c:g_steal_pointer Unexecuted instantiation: fu-hwids-fdt.c:g_steal_pointer Unexecuted instantiation: fu-hwids-kenv.c:g_steal_pointer Unexecuted instantiation: fu-hwids-darwin.c:g_steal_pointer Unexecuted instantiation: fu-hwids-smbios.c:g_steal_pointer Unexecuted instantiation: fu-ifd-bios.c:g_steal_pointer fu-ifd-firmware.c:g_steal_pointer Line | Count | Source | 235 | 1.20k | { | 236 | 1.20k | gpointer *ptr = (gpointer *) pp; | 237 | 1.20k | gpointer ref; | 238 | | | 239 | 1.20k | ref = *ptr; | 240 | 1.20k | *ptr = NULL; | 241 | | | 242 | 1.20k | return ref; | 243 | 1.20k | } |
fu-ifd-image.c:g_steal_pointer Line | Count | Source | 235 | 1.73k | { | 236 | 1.73k | gpointer *ptr = (gpointer *) pp; | 237 | 1.73k | gpointer ref; | 238 | | | 239 | 1.73k | ref = *ptr; | 240 | 1.73k | *ptr = NULL; | 241 | | | 242 | 1.73k | return ref; | 243 | 1.73k | } |
fu-ifwi-cpd-firmware.c:g_steal_pointer Line | Count | Source | 235 | 117 | { | 236 | 117 | gpointer *ptr = (gpointer *) pp; | 237 | 117 | gpointer ref; | 238 | | | 239 | 117 | ref = *ptr; | 240 | 117 | *ptr = NULL; | 241 | | | 242 | 117 | return ref; | 243 | 117 | } |
Unexecuted instantiation: fu-ifwi-cpd-image.c:g_steal_pointer fu-ifwi-fpt-firmware.c:g_steal_pointer Line | Count | Source | 235 | 53 | { | 236 | 53 | gpointer *ptr = (gpointer *) pp; | 237 | 53 | gpointer ref; | 238 | | | 239 | 53 | ref = *ptr; | 240 | 53 | *ptr = NULL; | 241 | | | 242 | 53 | return ref; | 243 | 53 | } |
fu-ihex-firmware.c:g_steal_pointer Line | Count | Source | 235 | 580k | { | 236 | 580k | gpointer *ptr = (gpointer *) pp; | 237 | 580k | gpointer ref; | 238 | | | 239 | 580k | ref = *ptr; | 240 | 580k | *ptr = NULL; | 241 | | | 242 | 580k | return ref; | 243 | 580k | } |
fu-input-stream.c:g_steal_pointer Line | Count | Source | 235 | 13.2M | { | 236 | 13.2M | gpointer *ptr = (gpointer *) pp; | 237 | 13.2M | gpointer ref; | 238 | | | 239 | 13.2M | ref = *ptr; | 240 | 13.2M | *ptr = NULL; | 241 | | | 242 | 13.2M | return ref; | 243 | 13.2M | } |
fu-memory-input-stream.c:g_steal_pointer Line | Count | Source | 235 | 772k | { | 236 | 772k | gpointer *ptr = (gpointer *) pp; | 237 | 772k | gpointer ref; | 238 | | | 239 | 772k | ref = *ptr; | 240 | 772k | *ptr = NULL; | 241 | | | 242 | 772k | return ref; | 243 | 772k | } |
Unexecuted instantiation: fu-intel-me-device.c:g_steal_pointer fu-intel-thunderbolt-firmware.c:g_steal_pointer Line | Count | Source | 235 | 77 | { | 236 | 77 | gpointer *ptr = (gpointer *) pp; | 237 | 77 | gpointer ref; | 238 | | | 239 | 77 | ref = *ptr; | 240 | 77 | *ptr = NULL; | 241 | | | 242 | 77 | return ref; | 243 | 77 | } |
fu-intel-thunderbolt-nvm.c:g_steal_pointer Line | Count | Source | 235 | 77 | { | 236 | 77 | gpointer *ptr = (gpointer *) pp; | 237 | 77 | gpointer ref; | 238 | | | 239 | 77 | ref = *ptr; | 240 | 77 | *ptr = NULL; | 241 | | | 242 | 77 | return ref; | 243 | 77 | } |
Unexecuted instantiation: fu-io-channel.c:g_steal_pointer Unexecuted instantiation: fu-ioctl.c:g_steal_pointer fu-json-firmware.c:g_steal_pointer Line | Count | Source | 235 | 95 | { | 236 | 95 | gpointer *ptr = (gpointer *) pp; | 237 | 95 | gpointer ref; | 238 | | | 239 | 95 | ref = *ptr; | 240 | 95 | *ptr = NULL; | 241 | | | 242 | 95 | return ref; | 243 | 95 | } |
Unexecuted instantiation: fu-json-parser.c:g_steal_pointer Unexecuted instantiation: fu-kenv.c:g_steal_pointer Unexecuted instantiation: fu-kernel.c:g_steal_pointer Unexecuted instantiation: fu-kernel-search-path.c:g_steal_pointer Unexecuted instantiation: fu-linear-firmware.c:g_steal_pointer Unexecuted instantiation: fu-lzma-common.c:g_steal_pointer Line | Count | Source | 235 | 397k | { | 236 | 397k | gpointer *ptr = (gpointer *) pp; | 237 | 397k | gpointer ref; | 238 | | | 239 | 397k | ref = *ptr; | 240 | 397k | *ptr = NULL; | 241 | | | 242 | 397k | return ref; | 243 | 397k | } |
fu-oprom-firmware.c:g_steal_pointer Line | Count | Source | 235 | 748 | { | 236 | 748 | gpointer *ptr = (gpointer *) pp; | 237 | 748 | gpointer ref; | 238 | | | 239 | 748 | ref = *ptr; | 240 | 748 | *ptr = NULL; | 241 | | | 242 | 748 | return ref; | 243 | 748 | } |
fu-partial-input-stream.c:g_steal_pointer Line | Count | Source | 235 | 1.50M | { | 236 | 1.50M | gpointer *ptr = (gpointer *) pp; | 237 | 1.50M | gpointer ref; | 238 | | | 239 | 1.50M | ref = *ptr; | 240 | 1.50M | *ptr = NULL; | 241 | | | 242 | 1.50M | return ref; | 243 | 1.50M | } |
Unexecuted instantiation: fu-path.c:g_steal_pointer Unexecuted instantiation: fu-path-store.c:g_steal_pointer fu-pefile-firmware.c:g_steal_pointer Line | Count | Source | 235 | 7.90k | { | 236 | 7.90k | gpointer *ptr = (gpointer *) pp; | 237 | 7.90k | gpointer ref; | 238 | | | 239 | 7.90k | ref = *ptr; | 240 | 7.90k | *ptr = NULL; | 241 | | | 242 | 7.90k | return ref; | 243 | 7.90k | } |
fu-protobuf.c:g_steal_pointer Line | Count | Source | 235 | 253 | { | 236 | 253 | gpointer *ptr = (gpointer *) pp; | 237 | 253 | gpointer ref; | 238 | | | 239 | 253 | ref = *ptr; | 240 | 253 | *ptr = NULL; | 241 | | | 242 | 253 | return ref; | 243 | 253 | } |
Unexecuted instantiation: fu-output-stream.c:g_steal_pointer Unexecuted instantiation: fu-progress.c:g_steal_pointer Unexecuted instantiation: fu-quirks.c:g_steal_pointer fu-sbatlevel-section.c:g_steal_pointer Line | Count | Source | 235 | 13 | { | 236 | 13 | gpointer *ptr = (gpointer *) pp; | 237 | 13 | gpointer ref; | 238 | | | 239 | 13 | ref = *ptr; | 240 | 13 | *ptr = NULL; | 241 | | | 242 | 13 | return ref; | 243 | 13 | } |
Unexecuted instantiation: fu-secure-bytes.c:g_steal_pointer Unexecuted instantiation: fu-security-attr.c:g_steal_pointer Unexecuted instantiation: fu-security-attrs.c:g_steal_pointer Unexecuted instantiation: fu-smbios.c:g_steal_pointer fu-srec-firmware.c:g_steal_pointer Line | Count | Source | 235 | 1.09M | { | 236 | 1.09M | gpointer *ptr = (gpointer *) pp; | 237 | 1.09M | gpointer ref; | 238 | | | 239 | 1.09M | ref = *ptr; | 240 | 1.09M | *ptr = NULL; | 241 | | | 242 | 1.09M | return ref; | 243 | 1.09M | } |
Unexecuted instantiation: fu-stream-input-stream.c:g_steal_pointer fu-string.c:g_steal_pointer Line | Count | Source | 235 | 159k | { | 236 | 159k | gpointer *ptr = (gpointer *) pp; | 237 | 159k | gpointer ref; | 238 | | | 239 | 159k | ref = *ptr; | 240 | 159k | *ptr = NULL; | 241 | | | 242 | 159k | return ref; | 243 | 159k | } |
Unexecuted instantiation: fu-sum.c:g_steal_pointer Unexecuted instantiation: fu-temporary-directory.c:g_steal_pointer Unexecuted instantiation: fu-tpm-eventlog-item.c:g_steal_pointer Unexecuted instantiation: fu-tpm-eventlog.c:g_steal_pointer fu-tpm-eventlog-v1.c:g_steal_pointer Line | Count | Source | 235 | 101 | { | 236 | 101 | gpointer *ptr = (gpointer *) pp; | 237 | 101 | gpointer ref; | 238 | | | 239 | 101 | ref = *ptr; | 240 | 101 | *ptr = NULL; | 241 | | | 242 | 101 | return ref; | 243 | 101 | } |
fu-tpm-eventlog-v2.c:g_steal_pointer Line | Count | Source | 235 | 4.19k | { | 236 | 4.19k | gpointer *ptr = (gpointer *) pp; | 237 | 4.19k | gpointer ref; | 238 | | | 239 | 4.19k | ref = *ptr; | 240 | 4.19k | *ptr = NULL; | 241 | | | 242 | 4.19k | return ref; | 243 | 4.19k | } |
Unexecuted instantiation: fu-udev-device.c:g_steal_pointer Unexecuted instantiation: fu-usb-bos-descriptor.c:g_steal_pointer Unexecuted instantiation: fu-usb-config-descriptor.c:g_steal_pointer Unexecuted instantiation: fu-usb-descriptor.c:g_steal_pointer fu-usb-device.c:g_steal_pointer Line | Count | Source | 235 | 194k | { | 236 | 194k | gpointer *ptr = (gpointer *) pp; | 237 | 194k | gpointer ref; | 238 | | | 239 | 194k | ref = *ptr; | 240 | 194k | *ptr = NULL; | 241 | | | 242 | 194k | return ref; | 243 | 194k | } |
Unexecuted instantiation: fu-usb-device-ds20.c:g_steal_pointer Unexecuted instantiation: fu-usb-device-fw-ds20.c:g_steal_pointer Unexecuted instantiation: fu-usb-device-ms-ds20.c:g_steal_pointer Unexecuted instantiation: fu-usb-endpoint.c:g_steal_pointer Unexecuted instantiation: fu-usb-hid-descriptor.c:g_steal_pointer Unexecuted instantiation: fu-usb-interface.c:g_steal_pointer fu-uswid-firmware.c:g_steal_pointer Line | Count | Source | 235 | 2 | { | 236 | 2 | gpointer *ptr = (gpointer *) pp; | 237 | 2 | gpointer ref; | 238 | | | 239 | 2 | ref = *ptr; | 240 | 2 | *ptr = NULL; | 241 | | | 242 | 2 | return ref; | 243 | 2 | } |
Unexecuted instantiation: fu-version-common.c:g_steal_pointer Unexecuted instantiation: fu-volume.c:g_steal_pointer Unexecuted instantiation: fu-volume-locker.c:g_steal_pointer Unexecuted instantiation: fu-x509-certificate.c:g_steal_pointer Unexecuted instantiation: fu-xor.c:g_steal_pointer fu-zip-firmware.c:g_steal_pointer Line | Count | Source | 235 | 10.1k | { | 236 | 10.1k | gpointer *ptr = (gpointer *) pp; | 237 | 10.1k | gpointer ref; | 238 | | | 239 | 10.1k | ref = *ptr; | 240 | 10.1k | *ptr = NULL; | 241 | | | 242 | 10.1k | return ref; | 243 | 10.1k | } |
Unexecuted instantiation: fu-zip-file.c:g_steal_pointer Unexecuted instantiation: fu-common-linux.c:g_steal_pointer Unexecuted instantiation: fu-darwin-efivars.c:g_steal_pointer Unexecuted instantiation: fu-fuzzer-firmware.c:g_steal_pointer Unexecuted instantiation: xb-builder.c:g_steal_pointer Unexecuted instantiation: xb-builder-fixup.c:g_steal_pointer xb-builder-node.c:g_steal_pointer Line | Count | Source | 235 | 146k | { | 236 | 146k | gpointer *ptr = (gpointer *) pp; | 237 | 146k | gpointer ref; | 238 | | | 239 | 146k | ref = *ptr; | 240 | 146k | *ptr = NULL; | 241 | | | 242 | 146k | return ref; | 243 | 146k | } |
Unexecuted instantiation: xb-builder-source.c:g_steal_pointer Unexecuted instantiation: xb-builder-source-ctx.c:g_steal_pointer Unexecuted instantiation: xb-common.c:g_steal_pointer Unexecuted instantiation: xb-node.c:g_steal_pointer Unexecuted instantiation: xb-node-query.c:g_steal_pointer Unexecuted instantiation: xb-query.c:g_steal_pointer Unexecuted instantiation: xb-query-context.c:g_steal_pointer Unexecuted instantiation: xb-silo.c:g_steal_pointer Unexecuted instantiation: xb-silo-export.c:g_steal_pointer Unexecuted instantiation: xb-silo-query.c:g_steal_pointer Unexecuted instantiation: xb-stack.c:g_steal_pointer Unexecuted instantiation: xb-string.c:g_steal_pointer Unexecuted instantiation: xb-value-bindings.c:g_steal_pointer Unexecuted instantiation: xb-version.c:g_steal_pointer Unexecuted instantiation: xb-zstd-decompressor.c:g_steal_pointer Unexecuted instantiation: xb-lzma-decompressor.c:g_steal_pointer Unexecuted instantiation: xb-machine.c:g_steal_pointer Unexecuted instantiation: xb-opcode.c:g_steal_pointer fu-ccgx-struct.c:g_steal_pointer Line | Count | Source | 235 | 422 | { | 236 | 422 | gpointer *ptr = (gpointer *) pp; | 237 | 422 | gpointer ref; | 238 | | | 239 | 422 | ref = *ptr; | 240 | 422 | *ptr = NULL; | 241 | | | 242 | 422 | return ref; | 243 | 422 | } |
Unexecuted instantiation: fu-ccgx-pure-hid-struct.c:g_steal_pointer Unexecuted instantiation: fu-ccgx-common.c:g_steal_pointer fu-ccgx-firmware.c:g_steal_pointer Line | Count | Source | 235 | 599k | { | 236 | 599k | gpointer *ptr = (gpointer *) pp; | 237 | 599k | gpointer ref; | 238 | | | 239 | 599k | ref = *ptr; | 240 | 599k | *ptr = NULL; | 241 | | | 242 | 599k | return ref; | 243 | 599k | } |
fu-genesys-usbhub-struct.c:g_steal_pointer Line | Count | Source | 235 | 695 | { | 236 | 695 | gpointer *ptr = (gpointer *) pp; | 237 | 695 | gpointer ref; | 238 | | | 239 | 695 | ref = *ptr; | 240 | 695 | *ptr = NULL; | 241 | | | 242 | 695 | return ref; | 243 | 695 | } |
fu-genesys-scaler-firmware.c:g_steal_pointer Line | Count | Source | 235 | 129 | { | 236 | 129 | gpointer *ptr = (gpointer *) pp; | 237 | 129 | gpointer ref; | 238 | | | 239 | 129 | ref = *ptr; | 240 | 129 | *ptr = NULL; | 241 | | | 242 | 129 | return ref; | 243 | 129 | } |
fu-genesys-usbhub-firmware.c:g_steal_pointer Line | Count | Source | 235 | 56 | { | 236 | 56 | gpointer *ptr = (gpointer *) pp; | 237 | 56 | gpointer ref; | 238 | | | 239 | 56 | ref = *ptr; | 240 | 56 | *ptr = NULL; | 241 | | | 242 | 56 | return ref; | 243 | 56 | } |
Unexecuted instantiation: fu-genesys-usbhub-dev-firmware.c:g_steal_pointer Unexecuted instantiation: fu-genesys-usbhub-pd-firmware.c:g_steal_pointer Unexecuted instantiation: fu-genesys-usbhub-codesign-firmware.c:g_steal_pointer Unexecuted instantiation: fu-cros-ec-struct.c:g_steal_pointer Unexecuted instantiation: fu-cros-ec-common.c:g_steal_pointer Unexecuted instantiation: fu-cros-ec-firmware.c:g_steal_pointer fu-acpi-phat-struct.c:g_steal_pointer Line | Count | Source | 235 | 25.7k | { | 236 | 25.7k | gpointer *ptr = (gpointer *) pp; | 237 | 25.7k | gpointer ref; | 238 | | | 239 | 25.7k | ref = *ptr; | 240 | 25.7k | *ptr = NULL; | 241 | | | 242 | 25.7k | return ref; | 243 | 25.7k | } |
fu-acpi-phat.c:g_steal_pointer Line | Count | Source | 235 | 465 | { | 236 | 465 | gpointer *ptr = (gpointer *) pp; | 237 | 465 | gpointer ref; | 238 | | | 239 | 465 | ref = *ptr; | 240 | 465 | *ptr = NULL; | 241 | | | 242 | 465 | return ref; | 243 | 465 | } |
fu-acpi-phat-health-record.c:g_steal_pointer Line | Count | Source | 235 | 901 | { | 236 | 901 | gpointer *ptr = (gpointer *) pp; | 237 | 901 | gpointer ref; | 238 | | | 239 | 901 | ref = *ptr; | 240 | 901 | *ptr = NULL; | 241 | | | 242 | 901 | return ref; | 243 | 901 | } |
fu-acpi-phat-version-element.c:g_steal_pointer Line | Count | Source | 235 | 2.22k | { | 236 | 2.22k | gpointer *ptr = (gpointer *) pp; | 237 | 2.22k | gpointer ref; | 238 | | | 239 | 2.22k | ref = *ptr; | 240 | 2.22k | *ptr = NULL; | 241 | | | 242 | 2.22k | return ref; | 243 | 2.22k | } |
fu-acpi-phat-version-record.c:g_steal_pointer Line | Count | Source | 235 | 5.90k | { | 236 | 5.90k | gpointer *ptr = (gpointer *) pp; | 237 | 5.90k | gpointer ref; | 238 | | | 239 | 5.90k | ref = *ptr; | 240 | 5.90k | *ptr = NULL; | 241 | | | 242 | 5.90k | return ref; | 243 | 5.90k | } |
Unexecuted instantiation: fu-pixart-rf-struct.c:g_steal_pointer Unexecuted instantiation: fu-pixart-rf-common.c:g_steal_pointer fu-pixart-rf-firmware.c:g_steal_pointer Line | Count | Source | 235 | 90 | { | 236 | 90 | gpointer *ptr = (gpointer *) pp; | 237 | 90 | gpointer ref; | 238 | | | 239 | 90 | ref = *ptr; | 240 | 90 | *ptr = NULL; | 241 | | | 242 | 90 | return ref; | 243 | 90 | } |
fu-ebitdo-struct.c:g_steal_pointer Line | Count | Source | 235 | 199 | { | 236 | 199 | gpointer *ptr = (gpointer *) pp; | 237 | 199 | gpointer ref; | 238 | | | 239 | 199 | ref = *ptr; | 240 | 199 | *ptr = NULL; | 241 | | | 242 | 199 | return ref; | 243 | 199 | } |
fu-ebitdo-firmware.c:g_steal_pointer Line | Count | Source | 235 | 97 | { | 236 | 97 | gpointer *ptr = (gpointer *) pp; | 237 | 97 | gpointer ref; | 238 | | | 239 | 97 | ref = *ptr; | 240 | 97 | *ptr = NULL; | 241 | | | 242 | 97 | return ref; | 243 | 97 | } |
Unexecuted instantiation: fu-realtek-alc408x-struct.c:g_steal_pointer Unexecuted instantiation: fu-realtek-alc408x-common.c:g_steal_pointer Unexecuted instantiation: fu-realtek-alc408x-firmware.c:g_steal_pointer fu-uf2-struct.c:g_steal_pointer Line | Count | Source | 235 | 11.9k | { | 236 | 11.9k | gpointer *ptr = (gpointer *) pp; | 237 | 11.9k | gpointer ref; | 238 | | | 239 | 11.9k | ref = *ptr; | 240 | 11.9k | *ptr = NULL; | 241 | | | 242 | 11.9k | return ref; | 243 | 11.9k | } |
fu-uf2-firmware.c:g_steal_pointer Line | Count | Source | 235 | 1.70k | { | 236 | 1.70k | gpointer *ptr = (gpointer *) pp; | 237 | 1.70k | gpointer ref; | 238 | | | 239 | 1.70k | ref = *ptr; | 240 | 1.70k | *ptr = NULL; | 241 | | | 242 | 1.70k | return ref; | 243 | 1.70k | } |
fu-amd-afc-struct.c:g_steal_pointer Line | Count | Source | 235 | 159k | { | 236 | 159k | gpointer *ptr = (gpointer *) pp; | 237 | 159k | gpointer ref; | 238 | | | 239 | 159k | ref = *ptr; | 240 | 159k | *ptr = NULL; | 241 | | | 242 | 159k | return ref; | 243 | 159k | } |
Unexecuted instantiation: fu-amd-afc-acpi-table.c:g_steal_pointer Unexecuted instantiation: fu-amd-afc-bios-setting.c:g_steal_pointer Unexecuted instantiation: fu-amd-afc-config-entry.c:g_steal_pointer Unexecuted instantiation: fu-amd-afc-config.c:g_steal_pointer Unexecuted instantiation: fu-amd-afc-form.c:g_steal_pointer Unexecuted instantiation: fu-amd-afc-varstore.c:g_steal_pointer Unexecuted instantiation: fu-amd-afc-option.c:g_steal_pointer Unexecuted instantiation: fu-amd-afc-pending.c:g_steal_pointer Unexecuted instantiation: fu-amd-afc-setting.c:g_steal_pointer fu-amd-afc-state.c:g_steal_pointer Line | Count | Source | 235 | 57.3k | { | 236 | 57.3k | gpointer *ptr = (gpointer *) pp; | 237 | 57.3k | gpointer ref; | 238 | | | 239 | 57.3k | ref = *ptr; | 240 | 57.3k | *ptr = NULL; | 241 | | | 242 | 57.3k | return ref; | 243 | 57.3k | } |
Unexecuted instantiation: fu-hughski-colorhug-struct.c:g_steal_pointer Unexecuted instantiation: fu-hughski-colorhug-device.c:g_steal_pointer Unexecuted instantiation: fu-wacom-usb-struct.c:g_steal_pointer fu-wacom-usb-firmware.c:g_steal_pointer Line | Count | Source | 235 | 2.91k | { | 236 | 2.91k | gpointer *ptr = (gpointer *) pp; | 237 | 2.91k | gpointer ref; | 238 | | | 239 | 2.91k | ref = *ptr; | 240 | 2.91k | *ptr = NULL; | 241 | | | 242 | 2.91k | return ref; | 243 | 2.91k | } |
fu-elantp-struct.c:g_steal_pointer Line | Count | Source | 235 | 284 | { | 236 | 284 | gpointer *ptr = (gpointer *) pp; | 237 | 284 | gpointer ref; | 238 | | | 239 | 284 | ref = *ptr; | 240 | 284 | *ptr = NULL; | 241 | | | 242 | 284 | return ref; | 243 | 284 | } |
fu-elantp-firmware.c:g_steal_pointer Line | Count | Source | 235 | 190 | { | 236 | 190 | gpointer *ptr = (gpointer *) pp; | 237 | 190 | gpointer ref; | 238 | | | 239 | 190 | ref = *ptr; | 240 | 190 | *ptr = NULL; | 241 | | | 242 | 190 | return ref; | 243 | 190 | } |
fu-redfish-struct.c:g_steal_pointer Line | Count | Source | 235 | 2.96k | { | 236 | 2.96k | gpointer *ptr = (gpointer *) pp; | 237 | 2.96k | gpointer ref; | 238 | | | 239 | 2.96k | ref = *ptr; | 240 | 2.96k | *ptr = NULL; | 241 | | | 242 | 2.96k | return ref; | 243 | 2.96k | } |
Unexecuted instantiation: fu-redfish-common.c:g_steal_pointer fu-redfish-smbios.c:g_steal_pointer Line | Count | Source | 235 | 53 | { | 236 | 53 | gpointer *ptr = (gpointer *) pp; | 237 | 53 | gpointer ref; | 238 | | | 239 | 53 | ref = *ptr; | 240 | 53 | *ptr = NULL; | 241 | | | 242 | 53 | return ref; | 243 | 53 | } |
Unexecuted instantiation: fu-elanfp-struct.c:g_steal_pointer fu-elanfp-firmware.c:g_steal_pointer Line | Count | Source | 235 | 100 | { | 236 | 100 | gpointer *ptr = (gpointer *) pp; | 237 | 100 | gpointer ref; | 238 | | | 239 | 100 | ref = *ptr; | 240 | 100 | *ptr = NULL; | 241 | | | 242 | 100 | return ref; | 243 | 100 | } |
fu-synaptics-prometheus-struct.c:g_steal_pointer Line | Count | Source | 235 | 3.84k | { | 236 | 3.84k | gpointer *ptr = (gpointer *) pp; | 237 | 3.84k | gpointer ref; | 238 | | | 239 | 3.84k | ref = *ptr; | 240 | 3.84k | *ptr = NULL; | 241 | | | 242 | 3.84k | return ref; | 243 | 3.84k | } |
fu-synaptics-prometheus-firmware.c:g_steal_pointer Line | Count | Source | 235 | 152 | { | 236 | 152 | gpointer *ptr = (gpointer *) pp; | 237 | 152 | gpointer ref; | 238 | | | 239 | 152 | ref = *ptr; | 240 | 152 | *ptr = NULL; | 241 | | | 242 | 152 | return ref; | 243 | 152 | } |
fu-synaptics-mst-struct.c:g_steal_pointer Line | Count | Source | 235 | 323 | { | 236 | 323 | gpointer *ptr = (gpointer *) pp; | 237 | 323 | gpointer ref; | 238 | | | 239 | 323 | ref = *ptr; | 240 | 323 | *ptr = NULL; | 241 | | | 242 | 323 | return ref; | 243 | 323 | } |
fu-synaptics-mst-firmware.c:g_steal_pointer Line | Count | Source | 235 | 70 | { | 236 | 70 | gpointer *ptr = (gpointer *) pp; | 237 | 70 | gpointer ref; | 238 | | | 239 | 70 | ref = *ptr; | 240 | 70 | *ptr = NULL; | 241 | | | 242 | 70 | return ref; | 243 | 70 | } |
fu-ccgx-dmc-struct.c:g_steal_pointer Line | Count | Source | 235 | 14.8k | { | 236 | 14.8k | gpointer *ptr = (gpointer *) pp; | 237 | 14.8k | gpointer ref; | 238 | | | 239 | 14.8k | ref = *ptr; | 240 | 14.8k | *ptr = NULL; | 241 | | | 242 | 14.8k | return ref; | 243 | 14.8k | } |
fu-ccgx-dmc-firmware.c:g_steal_pointer Line | Count | Source | 235 | 325k | { | 236 | 325k | gpointer *ptr = (gpointer *) pp; | 237 | 325k | gpointer ref; | 238 | | | 239 | 325k | ref = *ptr; | 240 | 325k | *ptr = NULL; | 241 | | | 242 | 325k | return ref; | 243 | 325k | } |
fu-synaptics-rmi-struct.c:g_steal_pointer Line | Count | Source | 235 | 45.2k | { | 236 | 45.2k | gpointer *ptr = (gpointer *) pp; | 237 | 45.2k | gpointer ref; | 238 | | | 239 | 45.2k | ref = *ptr; | 240 | 45.2k | *ptr = NULL; | 241 | | | 242 | 45.2k | return ref; | 243 | 45.2k | } |
Unexecuted instantiation: fu-synaptics-rmi-common.c:g_steal_pointer fu-synaptics-rmi-firmware.c:g_steal_pointer Line | Count | Source | 235 | 74 | { | 236 | 74 | gpointer *ptr = (gpointer *) pp; | 237 | 74 | gpointer ref; | 238 | | | 239 | 74 | ref = *ptr; | 240 | 74 | *ptr = NULL; | 241 | | | 242 | 74 | return ref; | 243 | 74 | } |
fu-bcm57xx-struct.c:g_steal_pointer Line | Count | Source | 235 | 2.99k | { | 236 | 2.99k | gpointer *ptr = (gpointer *) pp; | 237 | 2.99k | gpointer ref; | 238 | | | 239 | 2.99k | ref = *ptr; | 240 | 2.99k | *ptr = NULL; | 241 | | | 242 | 2.99k | return ref; | 243 | 2.99k | } |
fu-bcm57xx-common.c:g_steal_pointer Line | Count | Source | 235 | 49 | { | 236 | 49 | gpointer *ptr = (gpointer *) pp; | 237 | 49 | gpointer ref; | 238 | | | 239 | 49 | ref = *ptr; | 240 | 49 | *ptr = NULL; | 241 | | | 242 | 49 | return ref; | 243 | 49 | } |
fu-bcm57xx-dict-image.c:g_steal_pointer Line | Count | Source | 235 | 626 | { | 236 | 626 | gpointer *ptr = (gpointer *) pp; | 237 | 626 | gpointer ref; | 238 | | | 239 | 626 | ref = *ptr; | 240 | 626 | *ptr = NULL; | 241 | | | 242 | 626 | return ref; | 243 | 626 | } |
fu-bcm57xx-firmware.c:g_steal_pointer Line | Count | Source | 235 | 2.76k | { | 236 | 2.76k | gpointer *ptr = (gpointer *) pp; | 237 | 2.76k | gpointer ref; | 238 | | | 239 | 2.76k | ref = *ptr; | 240 | 2.76k | *ptr = NULL; | 241 | | | 242 | 2.76k | return ref; | 243 | 2.76k | } |
fu-bcm57xx-stage1-image.c:g_steal_pointer Line | Count | Source | 235 | 151 | { | 236 | 151 | gpointer *ptr = (gpointer *) pp; | 237 | 151 | gpointer ref; | 238 | | | 239 | 151 | ref = *ptr; | 240 | 151 | *ptr = NULL; | 241 | | | 242 | 151 | return ref; | 243 | 151 | } |
fu-bcm57xx-stage2-image.c:g_steal_pointer Line | Count | Source | 235 | 151 | { | 236 | 151 | gpointer *ptr = (gpointer *) pp; | 237 | 151 | gpointer ref; | 238 | | | 239 | 151 | ref = *ptr; | 240 | 151 | *ptr = NULL; | 241 | | | 242 | 151 | return ref; | 243 | 151 | } |
|
244 | | |
245 | | /* type safety */ |
246 | | #if defined(glib_typeof) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_58 |
247 | 31.5M | #define g_steal_pointer(pp) ((glib_typeof (*pp)) (g_steal_pointer) (pp)) |
248 | | #else /* __GNUC__ */ |
249 | | /* This version does not depend on gcc extensions, but gcc does not warn |
250 | | * about incompatible-pointer-types: */ |
251 | | #define g_steal_pointer(pp) \ |
252 | | (0 ? (*(pp)) : (g_steal_pointer) (pp)) |
253 | | #endif /* __GNUC__ */ |
254 | | |
255 | | /* Optimise: avoid the call to the (slower) _n function if we can |
256 | | * determine at compile-time that no overflow happens. |
257 | | */ |
258 | | #if defined (__GNUC__) && (__GNUC__ >= 2) && defined (__OPTIMIZE__) |
259 | | # define _G_NEW(struct_type, n_structs, func) \ |
260 | 14.4M | (struct_type *) (G_GNUC_EXTENSION ({ \ |
261 | 14.4M | gsize __n = (gsize) (n_structs); \ |
262 | 14.4M | gsize __s = sizeof (struct_type); \ |
263 | 14.4M | gpointer __p; \ |
264 | 14.4M | if (__s == 1) \ |
265 | 14.4M | __p = g_##func (__n); \ |
266 | 14.4M | else if (__builtin_constant_p (__n) && \ |
267 | 14.4M | (__s == 0 || __n <= G_MAXSIZE / __s)) \ |
268 | 14.4M | __p = g_##func (__n * __s); \ |
269 | 14.4M | else \ |
270 | 14.4M | __p = g_##func##_n (__n, __s); \ |
271 | 14.4M | __p; \ |
272 | 14.4M | })) |
273 | | # define _G_RENEW(struct_type, mem, n_structs, func) \ |
274 | | (struct_type *) (G_GNUC_EXTENSION ({ \ |
275 | | gsize __n = (gsize) (n_structs); \ |
276 | | gsize __s = sizeof (struct_type); \ |
277 | | gpointer __p = (gpointer) (mem); \ |
278 | | if (__s == 1) \ |
279 | | __p = g_##func (__p, __n); \ |
280 | | else if (__builtin_constant_p (__n) && \ |
281 | | (__s == 0 || __n <= G_MAXSIZE / __s)) \ |
282 | | __p = g_##func (__p, __n * __s); \ |
283 | | else \ |
284 | | __p = g_##func##_n (__p, __n, __s); \ |
285 | | __p; \ |
286 | | })) |
287 | | |
288 | | #else |
289 | | |
290 | | /* Unoptimised version: always call the _n() function. */ |
291 | | |
292 | | #define _G_NEW(struct_type, n_structs, func) \ |
293 | | ((struct_type *) g_##func##_n ((n_structs), sizeof (struct_type))) |
294 | | #define _G_RENEW(struct_type, mem, n_structs, func) \ |
295 | | ((struct_type *) g_##func##_n (mem, (n_structs), sizeof (struct_type))) |
296 | | |
297 | | #endif |
298 | | |
299 | | /** |
300 | | * g_new: |
301 | | * @struct_type: the type of the elements to allocate |
302 | | * @n_structs: the number of elements to allocate |
303 | | * |
304 | | * Allocates @n_structs elements of type @struct_type. |
305 | | * The returned pointer is cast to a pointer to the given type. |
306 | | * If @n_structs is 0 it returns %NULL. |
307 | | * Care is taken to avoid overflow when calculating the size of the allocated block. |
308 | | * |
309 | | * Since the returned pointer is already casted to the right type, |
310 | | * it is normally unnecessary to cast it explicitly, and doing |
311 | | * so might hide memory allocation errors. |
312 | | * |
313 | | * Returns: a pointer to the allocated memory, cast to a pointer to @struct_type |
314 | | */ |
315 | 832 | #define g_new(struct_type, n_structs) _G_NEW (struct_type, n_structs, malloc) |
316 | | /** |
317 | | * g_new0: |
318 | | * @struct_type: the type of the elements to allocate. |
319 | | * @n_structs: the number of elements to allocate. |
320 | | * |
321 | | * Allocates @n_structs elements of type @struct_type, initialized to 0's. |
322 | | * The returned pointer is cast to a pointer to the given type. |
323 | | * If @n_structs is 0 it returns %NULL. |
324 | | * Care is taken to avoid overflow when calculating the size of the allocated block. |
325 | | * |
326 | | * Since the returned pointer is already casted to the right type, |
327 | | * it is normally unnecessary to cast it explicitly, and doing |
328 | | * so might hide memory allocation errors. |
329 | | * |
330 | | * Returns: a pointer to the allocated memory, cast to a pointer to @struct_type. |
331 | | */ |
332 | 14.4M | #define g_new0(struct_type, n_structs) _G_NEW (struct_type, n_structs, malloc0) |
333 | | /** |
334 | | * g_renew: |
335 | | * @struct_type: the type of the elements to allocate |
336 | | * @mem: the currently allocated memory |
337 | | * @n_structs: the number of elements to allocate |
338 | | * |
339 | | * Reallocates the memory pointed to by @mem, so that it now has space for |
340 | | * @n_structs elements of type @struct_type. It returns the new address of |
341 | | * the memory, which may have been moved. |
342 | | * Care is taken to avoid overflow when calculating the size of the allocated block. |
343 | | * |
344 | | * Returns: a pointer to the new allocated memory, cast to a pointer to @struct_type |
345 | | */ |
346 | | #define g_renew(struct_type, mem, n_structs) _G_RENEW (struct_type, mem, n_structs, realloc) |
347 | | /** |
348 | | * g_try_new: |
349 | | * @struct_type: the type of the elements to allocate |
350 | | * @n_structs: the number of elements to allocate |
351 | | * |
352 | | * Attempts to allocate @n_structs elements of type @struct_type, and returns |
353 | | * %NULL on failure. Contrast with g_new(), which aborts the program on failure. |
354 | | * The returned pointer is cast to a pointer to the given type. |
355 | | * The function returns %NULL when @n_structs is 0 of if an overflow occurs. |
356 | | * |
357 | | * Since: 2.8 |
358 | | * Returns: a pointer to the allocated memory, cast to a pointer to @struct_type |
359 | | */ |
360 | | #define g_try_new(struct_type, n_structs) _G_NEW (struct_type, n_structs, try_malloc) |
361 | | /** |
362 | | * g_try_new0: |
363 | | * @struct_type: the type of the elements to allocate |
364 | | * @n_structs: the number of elements to allocate |
365 | | * |
366 | | * Attempts to allocate @n_structs elements of type @struct_type, initialized |
367 | | * to 0's, and returns %NULL on failure. Contrast with g_new0(), which aborts |
368 | | * the program on failure. |
369 | | * The returned pointer is cast to a pointer to the given type. |
370 | | * The function returns %NULL when @n_structs is 0 or if an overflow occurs. |
371 | | * |
372 | | * Since: 2.8 |
373 | | * Returns: a pointer to the allocated memory, cast to a pointer to @struct_type |
374 | | */ |
375 | | #define g_try_new0(struct_type, n_structs) _G_NEW (struct_type, n_structs, try_malloc0) |
376 | | /** |
377 | | * g_try_renew: |
378 | | * @struct_type: the type of the elements to allocate |
379 | | * @mem: the currently allocated memory |
380 | | * @n_structs: the number of elements to allocate |
381 | | * |
382 | | * Attempts to reallocate the memory pointed to by @mem, so that it now has |
383 | | * space for @n_structs elements of type @struct_type, and returns %NULL on |
384 | | * failure. Contrast with g_renew(), which aborts the program on failure. |
385 | | * It returns the new address of the memory, which may have been moved. |
386 | | * The function returns %NULL if an overflow occurs. |
387 | | * |
388 | | * Since: 2.8 |
389 | | * Returns: a pointer to the new allocated memory, cast to a pointer to @struct_type |
390 | | */ |
391 | | #define g_try_renew(struct_type, mem, n_structs) _G_RENEW (struct_type, mem, n_structs, try_realloc) |
392 | | |
393 | | |
394 | | /* Memory allocation virtualization for debugging purposes |
395 | | * g_mem_set_vtable() has to be the very first GLib function called |
396 | | * if being used |
397 | | */ |
398 | | struct _GMemVTable { |
399 | | gpointer (*malloc) (gsize n_bytes); |
400 | | gpointer (*realloc) (gpointer mem, |
401 | | gsize n_bytes); |
402 | | void (*free) (gpointer mem); |
403 | | /* optional; set to NULL if not used ! */ |
404 | | gpointer (*calloc) (gsize n_blocks, |
405 | | gsize n_block_bytes); |
406 | | gpointer (*try_malloc) (gsize n_bytes); |
407 | | gpointer (*try_realloc) (gpointer mem, |
408 | | gsize n_bytes); |
409 | | }; |
410 | | GLIB_DEPRECATED_IN_2_46 |
411 | | void g_mem_set_vtable (GMemVTable *vtable); |
412 | | GLIB_DEPRECATED_IN_2_46 |
413 | | gboolean g_mem_is_system_malloc (void); |
414 | | |
415 | | GLIB_VAR gboolean g_mem_gc_friendly; |
416 | | |
417 | | /* Memory profiler and checker, has to be enabled via g_mem_set_vtable() |
418 | | */ |
419 | | GLIB_VAR GMemVTable *glib_mem_profiler_table; |
420 | | GLIB_DEPRECATED_IN_2_46 |
421 | | void g_mem_profile (void); |
422 | | |
423 | | G_END_DECLS |
424 | | |
425 | | #endif /* __G_MEM_H__ */ |