mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
Bug 580450 – Reference counting and boxed types for arrays
Add reference counting and boxed types for GArray, GByteArray and GPtrArray. Signed-off-by: Matthias Clasen <mclasen@redhat.com>
This commit is contained in:
@@ -274,6 +274,39 @@ g_regex_get_type (void)
|
||||
return type_id;
|
||||
}
|
||||
|
||||
GType
|
||||
g_array_get_type (void)
|
||||
{
|
||||
static GType type_id = 0;
|
||||
if (!type_id)
|
||||
type_id = g_boxed_type_register_static (g_intern_static_string ("GArray"),
|
||||
(GBoxedCopyFunc) g_array_ref,
|
||||
(GBoxedFreeFunc) g_array_unref);
|
||||
return type_id;
|
||||
}
|
||||
|
||||
GType
|
||||
g_ptr_array_get_type (void)
|
||||
{
|
||||
static GType type_id = 0;
|
||||
if (!type_id)
|
||||
type_id = g_boxed_type_register_static (g_intern_static_string ("GPtrArray"),
|
||||
(GBoxedCopyFunc) g_ptr_array_ref,
|
||||
(GBoxedFreeFunc) g_ptr_array_unref);
|
||||
return type_id;
|
||||
}
|
||||
|
||||
GType
|
||||
g_byte_array_get_type (void)
|
||||
{
|
||||
static GType type_id = 0;
|
||||
if (!type_id)
|
||||
type_id = g_boxed_type_register_static (g_intern_static_string ("GByteArray"),
|
||||
(GBoxedCopyFunc) g_byte_array_ref,
|
||||
(GBoxedFreeFunc) g_byte_array_unref);
|
||||
return type_id;
|
||||
}
|
||||
|
||||
static void
|
||||
boxed_proxy_value_init (GValue *value)
|
||||
{
|
||||
|
Reference in New Issue
Block a user