diff options
author | Matthias Clasen <mclasen@redhat.com> | 2023-03-03 07:10:51 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2023-03-14 14:56:42 -0400 |
commit | a36123c802ba27e4e1fcb94c4b8cc9515bcf21ec (patch) | |
tree | 80f8a3bf5a3c37d92f9609bb0e512b8cd6b4a24e | |
parent | 9f88dba1622a02b44f49fc0079b7810e588347d3 (diff) | |
download | gtk+-a36123c802ba27e4e1fcb94c4b8cc9515bcf21ec.tar.gz |
gtk: Stop using g_slice
79 files changed, 287 insertions, 281 deletions
diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c index 1160f8cf9c..823c58a7ae 100644 --- a/gtk/gtkaboutdialog.c +++ b/gtk/gtkaboutdialog.c @@ -759,7 +759,7 @@ destroy_credit_section (gpointer data) CreditSection *cs = data; g_free (cs->heading); g_strfreev (cs->people); - g_slice_free (CreditSection, data); + g_free (data); } static void @@ -2324,7 +2324,7 @@ gtk_about_dialog_add_credit_section (GtkAboutDialog *about, g_return_if_fail (section_name != NULL); g_return_if_fail (people != NULL); - new_entry = g_slice_new (CreditSection); + new_entry = g_new (CreditSection, 1); new_entry->heading = g_strdup ((char *)section_name); new_entry->people = g_strdupv ((char **)people); diff --git a/gtk/gtkactionmuxer.c b/gtk/gtkactionmuxer.c index 7af7bb413b..5fe2916dfd 100644 --- a/gtk/gtkactionmuxer.c +++ b/gtk/gtkactionmuxer.c @@ -961,7 +961,7 @@ gtk_action_muxer_register_observer (GtkActionObservable *observable, if (action == NULL) { - action = g_slice_new (Action); + action = g_new (Action, 1); action->muxer = muxer; action->fullname = g_strdup (name); action->watchers = NULL; @@ -1023,7 +1023,7 @@ gtk_action_muxer_free_group (gpointer data) g_object_unref (group->group); g_free (group->prefix); - g_slice_free (Group, group); + g_free (group); } static void @@ -1038,7 +1038,7 @@ gtk_action_muxer_free_action (gpointer data) g_slist_free (action->watchers); g_free (action->fullname); - g_slice_free (Action, action); + g_free (action); } static void @@ -1276,7 +1276,7 @@ gtk_action_muxer_insert (GtkActionMuxer *muxer, if (!muxer->groups) muxer->groups = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, gtk_action_muxer_free_group); - group = g_slice_new0 (Group); + group = g_new0 (Group, 1); group->muxer = muxer; group->group = g_object_ref (action_group); group->prefix = g_strdup (prefix); diff --git a/gtk/gtkapplication-quartz.c b/gtk/gtkapplication-quartz.c index f4506ec441..a30d9b63d1 100644 --- a/gtk/gtkapplication-quartz.c +++ b/gtk/gtkapplication-quartz.c @@ -37,7 +37,7 @@ gtk_application_quartz_inhibitor_free (GtkApplicationQuartzInhibitor *inhibitor) { g_free (inhibitor->reason); g_clear_object (&inhibitor->window); - g_slice_free (GtkApplicationQuartzInhibitor, inhibitor); + g_free (inhibitor); } typedef GtkApplicationImplClass GtkApplicationImplQuartzClass; @@ -286,7 +286,7 @@ gtk_application_impl_quartz_inhibit (GtkApplicationImpl *impl, GtkApplicationImplQuartz *quartz = (GtkApplicationImplQuartz *) impl; GtkApplicationQuartzInhibitor *inhibitor; - inhibitor = g_slice_new (GtkApplicationQuartzInhibitor); + inhibitor = g_new (GtkApplicationQuartzInhibitor, 1); inhibitor->cookie = ++quartz->next_cookie; inhibitor->flags = flags; inhibitor->reason = g_strdup (reason); diff --git a/gtk/gtkapplication-wayland.c b/gtk/gtkapplication-wayland.c index 5d56f45e75..48c5183788 100644 --- a/gtk/gtkapplication-wayland.c +++ b/gtk/gtkapplication-wayland.c @@ -55,7 +55,7 @@ typedef struct static void gtk_application_wayland_inhibitor_free (GtkApplicationWaylandInhibitor *inhibitor) { - g_slice_free (GtkApplicationWaylandInhibitor, inhibitor); + g_free (inhibitor); } typedef struct @@ -127,7 +127,7 @@ gtk_application_impl_wayland_inhibit (GtkApplicationImpl *impl, if (!flags) return 0; - inhibitor = g_slice_new0 (GtkApplicationWaylandInhibitor); + inhibitor = g_new0 (GtkApplicationWaylandInhibitor, 1); inhibitor->cookie = ++wayland->next_cookie; inhibitor->flags = flags; wayland->inhibitors = g_slist_prepend (wayland->inhibitors, inhibitor); diff --git a/gtk/gtkbitset.c b/gtk/gtkbitset.c index 1ad8f54e82..1017e99815 100644 --- a/gtk/gtkbitset.c +++ b/gtk/gtkbitset.c @@ -92,7 +92,7 @@ gtk_bitset_unref (GtkBitset *self) return; ra_clear (&self->roaring.high_low_container); - g_slice_free (GtkBitset, self); + g_free (self); } /** @@ -271,7 +271,7 @@ gtk_bitset_new_empty (void) { GtkBitset *self; - self = g_slice_new0 (GtkBitset); + self = g_new0 (GtkBitset, 1); self->ref_count = 1; diff --git a/gtk/gtkbookmarksmanager.c b/gtk/gtkbookmarksmanager.c index ff13ea493e..2b65e4219c 100644 --- a/gtk/gtkbookmarksmanager.c +++ b/gtk/gtkbookmarksmanager.c @@ -39,7 +39,7 @@ _gtk_bookmark_free (gpointer data) g_object_unref (bookmark->file); g_free (bookmark->label); - g_slice_free (GtkBookmark, bookmark); + g_free (bookmark); } static void @@ -105,7 +105,7 @@ parse_bookmarks (const char *contents) if (!g_utf8_validate (lines[i], -1, NULL)) continue; - bookmark = g_slice_new0 (GtkBookmark); + bookmark = g_new0 (GtkBookmark, 1); if ((space = strchr (lines[i], ' ')) != NULL) { @@ -419,7 +419,7 @@ _gtk_bookmarks_manager_insert_bookmark (GtkBookmarksManager *manager, return FALSE; } - bookmark = g_slice_new0 (GtkBookmark); + bookmark = g_new0 (GtkBookmark, 1); bookmark->file = g_object_ref (file); manager->bookmarks = g_slist_insert (manager->bookmarks, bookmark, position); diff --git a/gtk/gtkborder.c b/gtk/gtkborder.c index 443a90687e..ce15b9bf13 100644 --- a/gtk/gtkborder.c +++ b/gtk/gtkborder.c @@ -37,7 +37,7 @@ GtkBorder * gtk_border_new (void) { - return g_slice_new0 (GtkBorder); + return g_new0 (GtkBorder, 1); } /** @@ -51,9 +51,13 @@ gtk_border_new (void) GtkBorder * gtk_border_copy (const GtkBorder *border_) { + GtkBorder *copy; + g_return_val_if_fail (border_ != NULL, NULL); - return g_slice_dup (GtkBorder, border_); + copy = g_new0 (GtkBorder, 1); + memcpy (copy, border_, sizeof (GtkBorder)); + return copy; } /** @@ -65,7 +69,7 @@ gtk_border_copy (const GtkBorder *border_) void gtk_border_free (GtkBorder *border_) { - g_slice_free (GtkBorder, border_); + g_free (border_); } G_DEFINE_BOXED_TYPE (GtkBorder, gtk_border, diff --git a/gtk/gtkbuilder-menus.c b/gtk/gtkbuilder-menus.c index fcf8731802..7855885173 100644 --- a/gtk/gtkbuilder-menus.c +++ b/gtk/gtkbuilder-menus.c @@ -55,7 +55,7 @@ gtk_builder_menu_push_frame (GtkBuilderMenuState *state, { struct frame *new; - new = g_slice_new (struct frame); + new = g_new (struct frame, 1); *new = state->frame; state->frame.menu = menu; @@ -77,7 +77,7 @@ gtk_builder_menu_pop_frame (GtkBuilderMenuState *state) state->frame = *prev; - g_slice_free (struct frame, prev); + g_free (prev); } static void @@ -335,7 +335,7 @@ gtk_builder_menu_error (GtkBuildableParseContext *context, state->frame = *prev; - g_slice_free (struct frame, prev); + g_free (prev); } if (state->string) @@ -347,7 +347,7 @@ gtk_builder_menu_error (GtkBuildableParseContext *context, g_free (state->attribute); g_free (state->context); - g_slice_free (GtkBuilderMenuState, state); + g_free (state); } static GtkBuildableParser gtk_builder_menu_subparser = @@ -368,7 +368,7 @@ _gtk_builder_menu_start (ParserData *parser_data, GtkBuilderMenuState *state; char *id; - state = g_slice_new0 (GtkBuilderMenuState); + state = g_new0 (GtkBuilderMenuState, 1); state->parser_data = parser_data; gtk_buildable_parse_context_push (&parser_data->ctx, >k_builder_menu_subparser, state); @@ -394,5 +394,5 @@ _gtk_builder_menu_end (ParserData *parser_data) g_assert (state->frame.prev == NULL); g_assert (state->frame.item == NULL); g_assert (state->frame.menu == NULL); - g_slice_free (GtkBuilderMenuState, state); + g_free (state); } diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c index 1ae1f3e81a..fd221f79c8 100644 --- a/gtk/gtkbuilder.c +++ b/gtk/gtkbuilder.c @@ -587,7 +587,7 @@ gtk_builder_get_parameters (GtkBuilder *builder, prop->applied = TRUE; - property = g_slice_new (DelayedProperty); + property = g_new (DelayedProperty, 1); property->pspec = prop->pspec; property->object = g_strdup (object_name); property->value = g_strdup (prop->text->str); @@ -1096,7 +1096,7 @@ gtk_builder_apply_delayed_properties (GtkBuilder *builder, g_free (property->value); g_free (property->object); - g_slice_free (DelayedProperty, property); + g_free (property); } g_slist_free (props); diff --git a/gtk/gtkbuilderparser.c b/gtk/gtkbuilderparser.c index 1d2d0b3d0b..a1a7bd68c0 100644 --- a/gtk/gtkbuilderparser.c +++ b/gtk/gtkbuilderparser.c @@ -527,7 +527,7 @@ parse_requires (ParserData *data, version_minor = g_ascii_strtoll (split[1], NULL, 10); g_strfreev (split); - req_info = g_slice_new0 (RequiresInfo); + req_info = g_new0 (RequiresInfo, 1); req_info->library = g_strdup (library); req_info->major = version_major; req_info->minor = version_minor; @@ -659,7 +659,7 @@ parse_object (GtkBuildableParseContext *context, } } - object_info = g_slice_new0 (ObjectInfo); + object_info = g_new0 (ObjectInfo, 1); object_info->tag_type = TAG_OBJECT; object_info->type = object_type; object_info->oclass = g_type_class_ref (object_type); @@ -766,7 +766,7 @@ parse_template (GtkBuildableParseContext *context, ++data->cur_object_level; - object_info = g_slice_new0 (ObjectInfo); + object_info = g_new0 (ObjectInfo, 1); object_info->tag_type = TAG_TEMPLATE; object_info->type = parsed_type; object_info->oclass = g_type_class_ref (parsed_type); @@ -802,7 +802,7 @@ free_object_info (ObjectInfo *info) g_ptr_array_free (info->properties, TRUE); g_free (info->constructor); g_free (info->id); - g_slice_free (ObjectInfo, info); + g_free (info); } static void @@ -836,7 +836,7 @@ parse_child (ParserData *data, return; } - child_info = g_slice_new0 (ChildInfo); + child_info = g_new0 (ChildInfo, 1); child_info->tag_type = TAG_CHILD; child_info->type = g_strdup (type); child_info->internal_child = g_strdup (internal_child); @@ -851,7 +851,7 @@ free_child_info (ChildInfo *info) { g_free (info->type); g_free (info->internal_child); - g_slice_free (ChildInfo, info); + g_free (info); } static void @@ -924,7 +924,7 @@ parse_property (ParserData *data, { BindingInfo *binfo; - binfo = g_slice_new0 (BindingInfo); + binfo = g_new0 (BindingInfo, 1); binfo->tag_type = TAG_BINDING; binfo->target = NULL; binfo->target_pspec = pspec; @@ -944,7 +944,7 @@ parse_property (ParserData *data, return; } - info = g_slice_new0 (PropertyInfo); + info = g_new0 (PropertyInfo, 1); info->tag_type = TAG_PROPERTY; info->pspec = pspec; info->text = g_string_new (""); @@ -1022,7 +1022,7 @@ parse_binding (ParserData *data, } - info = g_slice_new0 (BindingExpressionInfo); + info = g_new0 (BindingExpressionInfo, 1); info->tag_type = TAG_BINDING_EXPRESSION; info->target = NULL; info->target_pspec = pspec; @@ -1044,7 +1044,7 @@ free_property_info (PropertyInfo *info) } g_string_free (info->text, TRUE); g_free (info->context); - g_slice_free (PropertyInfo, info); + g_free (info); } static void @@ -1075,7 +1075,7 @@ free_expression_info (ExpressionInfo *info) g_assert_not_reached (); break; } - g_slice_free (ExpressionInfo, info); + g_free (info); } static gboolean @@ -1161,7 +1161,7 @@ parse_constant_expression (ParserData *data, } } - info = g_slice_new0 (ExpressionInfo); + info = g_new0 (ExpressionInfo, 1); info->tag_type = TAG_EXPRESSION; info->expression_type = EXPRESSION_CONSTANT; info->constant.type = type; @@ -1221,7 +1221,7 @@ parse_closure_expression (ParserData *data, swapped = FALSE; } - info = g_slice_new0 (ExpressionInfo); + info = g_new0 (ExpressionInfo, 1); info->tag_type = TAG_EXPRESSION; info->expression_type = EXPRESSION_CLOSURE; info->closure.type = type; @@ -1277,7 +1277,7 @@ parse_lookup_expression (ParserData *data, } } - info = g_slice_new0 (ExpressionInfo); + info = g_new0 (ExpressionInfo, 1); info->tag_type = TAG_EXPRESSION; info->expression_type = EXPRESSION_PROPERTY; info->property.this_type = type; @@ -1513,7 +1513,7 @@ parse_signal (ParserData *data, swapped = FALSE; } - info = g_slice_new0 (SignalInfo); + info = g_new0 (SignalInfo, 1); info->id = id; info->detail = detail; info->handler = g_strdup (handler); @@ -1535,7 +1535,7 @@ _free_signal_info (SignalInfo *info, g_free (info->handler); g_free (info->connect_object_name); g_free (info->object_name); - g_slice_free (SignalInfo, info); + g_free (info); } void @@ -1544,7 +1544,7 @@ _free_binding_info (BindingInfo *info, { g_free (info->source); g_free (info->source_property); - g_slice_free (BindingInfo, info); + g_free (info); } void @@ -1553,7 +1553,7 @@ free_binding_expression_info (BindingExpressionInfo *info) if (info->expr) free_expression_info (info->expr); g_free (info->object_name); - g_slice_free (BindingExpressionInfo, info); + g_free (info); } static void @@ -1561,7 +1561,7 @@ free_requires_info (RequiresInfo *info, gpointer user_data) { g_free (info->library); - g_slice_free (RequiresInfo, info); + g_free (info); } static void @@ -1604,7 +1604,7 @@ create_subparser (GObject *object, { SubParser *subparser; - subparser = g_slice_new0 (SubParser); + subparser = g_new0 (SubParser, 1); subparser->object = object; subparser->child = child; subparser->tagname = g_strdup (element_name); @@ -1620,7 +1620,7 @@ static void free_subparser (SubParser *subparser) { g_free (subparser->tagname); - g_slice_free (SubParser, subparser); + g_free (subparser); } static gboolean @@ -2141,7 +2141,7 @@ text (GtkBuildableParseContext *context, text_len--; if (expr_info->property.expression == NULL && text_len > 0) { - ExpressionInfo *constant = g_slice_new0 (ExpressionInfo); + ExpressionInfo *constant = g_new0 (ExpressionInfo, 1); constant->tag_type = TAG_EXPRESSION; constant->expression_type = EXPRESSION_CONSTANT; constant->constant.type = G_TYPE_INVALID; diff --git a/gtk/gtkbuilderprecompile.c b/gtk/gtkbuilderprecompile.c index 398fd75eb2..9db86e06e0 100644 --- a/gtk/gtkbuilderprecompile.c +++ b/gtk/gtkbuilderprecompile.c @@ -34,7 +34,6 @@ typedef enum /* All strings are owned by the string chunk */ typedef struct { - /* Must be first for g_slice_free_chain() */ GList link; const char *string; @@ -82,7 +81,7 @@ record_data_node_new (RecordDataElement *parent, RecordDataType type, gsize size) { - RecordDataNode *node = g_slice_alloc0 (size); + RecordDataNode *node = g_malloc0 (size); node->type = type; node->link.data = node; @@ -163,12 +162,11 @@ record_data_node_free (RecordDataNode *node) l = next; } - g_slice_free1 (sizeof (RecordDataElement) + - sizeof (RecordDataString) * element->n_attributes, element); + g_free (element); break; case RECORD_TYPE_TEXT: text = (RecordDataText *)node; - g_slice_free (RecordDataText, text); + g_free (text); break; case RECORD_TYPE_END_ELEMENT: default: @@ -234,7 +232,7 @@ record_data_string_lookup (RecordData *data, return s; } - s = g_slice_new (RecordDataString); + s = g_new (RecordDataString, 1); /* The string is zero terminated */ s->string = g_string_chunk_insert_len (data->chunks, str, len); s->len = len; @@ -474,6 +472,7 @@ _gtk_buildable_parser_precompile (const char *text, GList *l; GString *marshaled; int offset; + RecordDataString *node; data.strings = g_hash_table_new (record_data_string_hash, record_data_string_equal); data.chunks = g_string_chunk_new (512); @@ -528,9 +527,14 @@ _gtk_buildable_parser_precompile (const char *text, marshal_root (marshaled, &data.root->base); - g_slice_free_chain (RecordDataString, - (RecordDataString *)data.string_list.head, - link.next); + node = (RecordDataString *) data.string_list.head; + while (node) + { + RecordDataString *next = (RecordDataString *) node->link.next; + g_free (node); + node = next; + } + record_data_node_free (&data.root->base); g_string_chunk_free (data.chunks); g_hash_table_destroy (data.strings); diff --git a/gtk/gtkconstraintvflparser.c b/gtk/gtkconstraintvflparser.c index 79be0b0037..77f75ae681 100644 --- a/gtk/gtkconstraintvflparser.c +++ b/gtk/gtkconstraintvflparser.c @@ -768,7 +768,7 @@ vfl_view_free (VflView *view) view->prev_view = NULL; view->next_view = NULL; - g_slice_free (VflView, view); + g_free (view); } static void @@ -878,7 +878,7 @@ gtk_constraint_vfl_parser_parse_line (GtkConstraintVflParser *parser, { if (parser->views == NULL && parser->leading_super == NULL) { - parser->leading_super = g_slice_new0 (VflView); + parser->leading_super = g_new0 (VflView, 1); parser->leading_super->name = g_strdup ("super"); parser->leading_super->orientation = parser->orientation; @@ -888,7 +888,7 @@ gtk_constraint_vfl_parser_parse_line (GtkConstraintVflParser *parser, } else if (parser->trailing_super == NULL) { - parser->trailing_super = g_slice_new0 (VflView); + parser->trailing_super = g_new0 (VflView, 1); parser->trailing_super->name = g_strdup ("super"); parser->trailing_super->orientation = parser->orientation; @@ -1040,7 +1040,7 @@ gtk_constraint_vfl_parser_parse_line (GtkConstraintVflParser *parser, if (*cur == '[') { - VflView *view = g_slice_new0 (VflView); + VflView *view = g_new0 (VflView, 1); char *tmp; view->orientation = parser->orientation; diff --git a/gtk/gtkcssanimation.c b/gtk/gtkcssanimation.c index 1d0c474d2c..26d8e1f30e 100644 --- a/gtk/gtkcssanimation.c +++ b/gtk/gtkcssanimation.c @@ -140,7 +140,7 @@ gtk_css_animation_free (GtkStyleAnimation *animation) _gtk_css_keyframes_unref (self->keyframes); _gtk_css_value_unref (self->ease); - g_slice_free (GtkCssAnimation, self); + g_free (self); } static const GtkStyleAnimationClass GTK_CSS_ANIMATION_CLASS = { @@ -172,7 +172,7 @@ _gtk_css_animation_new (const char *name, g_return_val_if_fail (ease != NULL, NULL); g_return_val_if_fail (iteration_count >= 0, NULL); - animation = g_slice_alloc (sizeof (GtkCssAnimation)); + animation = g_new (GtkCssAnimation, 1); animation->parent.class = >K_CSS_ANIMATION_CLASS; animation->parent.ref_count = 1; @@ -203,7 +203,7 @@ _gtk_css_animation_advance_with_play_state (GtkCssAnimation *source, gint64 timestamp, GtkCssPlayState play_state) { - GtkCssAnimation *animation = g_slice_alloc (sizeof (GtkCssAnimation)); + GtkCssAnimation *animation = g_new (GtkCssAnimation, 1); animation->parent.class = >K_CSS_ANIMATION_CLASS; animation->parent.ref_count = 1; diff --git a/gtk/gtkcssarrayvalue.c b/gtk/gtkcssarrayvalue.c index 28bea64088..fcc973e06a 100644 --- a/gtk/gtkcssarrayvalue.c +++ b/gtk/gtkcssarrayvalue.c @@ -35,11 +35,9 @@ gtk_css_value_array_free (GtkCssValue *value) guint i; for (i = 0; i < value->n_values; i++) - { - _gtk_css_value_unref (value->values[i]); - } + _gtk_css_value_unref (value->values[i]); - g_slice_free1 (sizeof (GtkCssValue) + sizeof (GtkCssValue *) * (value->n_values - 1), value); + g_free (value); } static GtkCssValue * diff --git a/gtk/gtkcssbgsizevalue.c b/gtk/gtkcssbgsizevalue.c index eb54840016..b9ff4141e5 100644 --- a/gtk/gtkcssbgsizevalue.c +++ b/gtk/gtkcssbgsizevalue.c @@ -37,7 +37,7 @@ gtk_css_value_bg_size_free (GtkCssValue *value) if (value->y) _gtk_css_value_unref (value->y); - g_slice_free (GtkCssValue, value); + g_free (value); } static GtkCssValue * diff --git a/gtk/gtkcssbordervalue.c b/gtk/gtkcssbordervalue.c index a9b9ef0001..68f96d087f 100644 --- a/gtk/gtkcssbordervalue.c +++ b/gtk/gtkcssbordervalue.c @@ -38,7 +38,7 @@ gtk_css_value_border_free (GtkCssValue *value) _gtk_css_value_unref (value->values[i]); } - g_slice_free (GtkCssValue, value); + g_free (value); } static GtkCssValue * diff --git a/gtk/gtkcsscolorvalue.c b/gtk/gtkcsscolorvalue.c index b326b9cae9..c4d2ecb685 100644 --- a/gtk/gtkcsscolorvalue.c +++ b/gtk/gtkcsscolorvalue.c @@ -90,7 +90,7 @@ gtk_css_value_color_free (GtkCssValue *color) break; } - g_slice_free (GtkCssValue, color); + g_free (color); } static GtkCssValue * diff --git a/gtk/gtkcsscornervalue.c b/gtk/gtkcsscornervalue.c index b25e6a6fef..498f2505a8 100644 --- a/gtk/gtkcsscornervalue.c +++ b/gtk/gtkcsscornervalue.c @@ -33,7 +33,7 @@ gtk_css_value_corner_free (GtkCssValue *value) _gtk_css_value_unref (value->x); _gtk_css_value_unref (value->y); - g_slice_free (GtkCssValue, value); + g_free (value); } static GtkCssValue * diff --git a/gtk/gtkcssdynamic.c b/gtk/gtkcssdynamic.c index 5dc65101ab..75c49833fe 100644 --- a/gtk/gtkcssdynamic.c +++ b/gtk/gtkcssdynamic.c @@ -70,7 +70,7 @@ gtk_css_dynamic_is_static (GtkStyleAnimation *style_animation) static void gtk_css_dynamic_free (GtkStyleAnimation *animation) { - g_slice_free (GtkCssDynamic, (GtkCssDynamic *)animation); + g_free (animation); } static const GtkStyleAnimationClass GTK_CSS_DYNAMIC_CLASS = { @@ -85,7 +85,7 @@ static const GtkStyleAnimationClass GTK_CSS_DYNAMIC_CLASS = { GtkStyleAnimation * gtk_css_dynamic_new (gint64 timestamp) { - GtkCssDynamic *dynamic = g_slice_alloc (sizeof (GtkCssDynamic)); + GtkCssDynamic *dynamic = g_new (GtkCssDynamic, 1); dynamic->parent.class = >K_CSS_DYNAMIC_CLASS; dynamic->parent.ref_count = 1; diff --git a/gtk/gtkcsseasevalue.c b/gtk/gtkcsseasevalue.c index 5ea1c6285d..83327e1104 100644 --- a/gtk/gtkcsseasevalue.c +++ b/gtk/gtkcsseasevalue.c @@ -46,7 +46,7 @@ struct _GtkCssValue { static void gtk_css_value_ease_free (GtkCssValue *value) { - g_slice_free (GtkCssValue, value); + g_free (value); } static GtkCssValue * diff --git a/gtk/gtkcssenumvalue.c b/gtk/gtkcssenumvalue.c index dfb7a0d394..fcf613eb24 100644 --- a/gtk/gtkcssenumvalue.c +++ b/gtk/gtkcssenumvalue.c @@ -37,7 +37,7 @@ struct _GtkCssValue { static void gtk_css_value_enum_free (GtkCssValue *value) { - g_slice_free (GtkCssValue, value); + g_free (value); } static GtkCssValue * diff --git a/gtk/gtkcssfiltervalue.c b/gtk/gtkcssfiltervalue.c index ed334979cb..1178a7f2ce 100644 --- a/gtk/gtkcssfiltervalue.c +++ b/gtk/gtkcssfiltervalue.c @@ -296,11 +296,9 @@ gtk_css_value_filter_free (GtkCssValue *value) guint i; for (i = 0; i < value->n_filters; i++) - { - gtk_css_filter_clear (&value->filters[i]); - } + gtk_css_filter_clear (&value->filters[i]); - g_slice_free1 (sizeof (GtkCssValue) + sizeof (GtkCssFilter) * (value->n_filters - 1), value); + g_free (value); } /* returns TRUE if dest == src */ diff --git a/gtk/gtkcssfontfeaturesvalue.c b/gtk/gtkcssfontfeaturesvalue.c index faedc8cf44..323af6992d 100644 --- a/gtk/gtkcssfontfeaturesvalue.c +++ b/gtk/gtkcssfontfeaturesvalue.c @@ -49,7 +49,7 @@ gtk_css_value_font_features_free (GtkCssValue *value) { g_hash_table_unref (value->features); - g_slice_free (GtkCssValue, value); + g_free (value); } static GtkCssValue * diff --git a/gtk/gtkcssfontvariationsvalue.c b/gtk/gtkcssfontvariationsvalue.c index 2ecae30ab0..3b9eae6dd5 100644 --- a/gtk/gtkcssfontvariationsvalue.c +++ b/gtk/gtkcssfontvariationsvalue.c @@ -48,7 +48,7 @@ gtk_css_value_font_variations_free (GtkCssValue *value) { g_hash_table_unref (value->axes); - g_slice_free (GtkCssValue, value); + g_free (value); } static GtkCssValue * diff --git a/gtk/gtkcssimagevalue.c b/gtk/gtkcssimagevalue.c index 933557f65f..1443601cc0 100644 --- a/gtk/gtkcssimagevalue.c +++ b/gtk/gtkcssimagevalue.c @@ -30,7 +30,7 @@ static void gtk_css_value_image_free (GtkCssValue *value) { g_object_unref (value->image); - g_slice_free (GtkCssValue, value); + g_free (value); } static GtkCssValue * diff --git a/gtk/gtkcsskeyframes.c b/gtk/gtkcsskeyframes.c index 89c4b0b409..68191d476c 100644 --- a/gtk/gtkcsskeyframes.c +++ b/gtk/gtkcsskeyframes.c @@ -75,7 +75,7 @@ _gtk_css_keyframes_unref (GtkCssKeyframes *keyframes) } g_free (keyframes->values); - g_slice_free (GtkCssKeyframes, keyframes); + g_free (keyframes); } static guint @@ -178,7 +178,7 @@ gtk_css_keyframes_alloc (void) { GtkCssKeyframes *keyframes; - keyframes = g_slice_new0 (GtkCssKeyframes); + keyframes = g_new0 (GtkCssKeyframes, 1); keyframes->ref_count = 1; return keyframes; diff --git a/gtk/gtkcsslineheightvalue.c b/gtk/gtkcsslineheightvalue.c index 4472f503bc..c89d0a1ab0 100644 --- a/gtk/gtkcsslineheightvalue.c +++ b/gtk/gtkcsslineheightvalue.c @@ -35,7 +35,7 @@ static void gtk_css_value_line_height_free (GtkCssValue *value) { _gtk_css_value_unref (value->height); - g_slice_free (GtkCssValue, value); + g_free (value); } static GtkCssValue * diff --git a/gtk/gtkcssnodestylecache.c b/gtk/gtkcssnodestylecache.c index 46b3974341..dbb244698a 100644 --- a/gtk/gtkcssnodestylecache.c +++ b/gtk/gtkcssnodestylecache.c @@ -37,7 +37,7 @@ gtk_css_node_style_cache_new (GtkCssStyle *style) { GtkCssNodeStyleCache *result; - result = g_slice_new0 (GtkCssNodeStyleCache); + result = g_new0 (GtkCssNodeStyleCache, 1); result->ref_count = 1; result->style = g_object_ref (style); @@ -65,7 +65,7 @@ gtk_css_node_style_cache_unref (GtkCssNodeStyleCache *cache) if (cache->children) g_hash_table_unref (cache->children); - g_slice_free (GtkCssNodeStyleCache, cache); + g_free (cache); } GtkCssStyle * diff --git a/gtk/gtkcssnumbervalue.c b/gtk/gtkcssnumbervalue.c index 270711b27c..3ab0e3e1cb 100644 --- a/gtk/gtkcssnumbervalue.c +++ b/gtk/gtkcssnumbervalue.c @@ -79,13 +79,9 @@ gtk_css_value_number_free (GtkCssValue *number) for (guint i = 0; i < n_terms; i++) _gtk_css_value_unref (number->calc.terms[i]); - - g_slice_free1 (gtk_css_value_calc_get_size (n_terms), number); - } - else - { - g_slice_free (GtkCssValue, number); } + + g_free (number); } static double diff --git a/gtk/gtkcsspalettevalue.c b/gtk/gtkcsspalettevalue.c index a5aab3d615..bbc5c1cf31 100644 --- a/gtk/gtkcsspalettevalue.c +++ b/gtk/gtkcsspalettevalue.c @@ -99,8 +99,7 @@ gtk_css_value_palette_free (GtkCssValue *value) g_free (value->color_names); g_free (value->color_values); - - g_slice_free (GtkCssValue, value); + g_free (value); } static GtkCssValue * diff --git a/gtk/gtkcsspositionvalue.c b/gtk/gtkcsspositionvalue.c index 4164d18ca2..3bcc291832 100644 --- a/gtk/gtkcsspositionvalue.c +++ b/gtk/gtkcsspositionvalue.c @@ -32,8 +32,7 @@ gtk_css_value_position_free (GtkCssValue *value) { _gtk_css_value_unref (value->x); _gtk_css_value_unref (value->y); - - g_slice_free (GtkCssValue, value); + g_free (value); } static GtkCssValue * diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c index bdcaadbcfd..5ace762e7a 100644 --- a/gtk/gtkcssprovider.c +++ b/gtk/gtkcssprovider.c @@ -318,7 +318,7 @@ gtk_css_scanner_destroy (GtkCssScanner *scanner) g_object_unref (scanner->provider); gtk_css_parser_unref (scanner->parser); - g_slice_free (GtkCssScanner, scanner); + g_free (scanner); } static void @@ -356,7 +356,7 @@ gtk_css_scanner_new (GtkCssProvider *provider, { GtkCssScanner *scanner; - scanner = g_slice_new0 (GtkCssScanner); + scanner = g_new0 (GtkCssScanner, 1); g_object_ref (provider); scanner->provider = provider; diff --git a/gtk/gtkcssrepeatvalue.c b/gtk/gtkcssrepeatvalue.c index 26a7ac27fa..928c4ecba2 100644 --- a/gtk/gtkcssrepeatvalue.c +++ b/gtk/gtkcssrepeatvalue.c @@ -30,7 +30,7 @@ struct _GtkCssValue { static void gtk_css_value_repeat_free (GtkCssValue *value) { - g_slice_free (GtkCssValue, value); + g_free (value); } static GtkCssValue * diff --git a/gtk/gtkcssshadowvalue.c b/gtk/gtkcssshadowvalue.c index 66029dbff4..e670356550 100644 --- a/gtk/gtkcssshadowvalue.c +++ b/gtk/gtkcssshadowvalue.c @@ -108,7 +108,7 @@ gtk_css_value_shadow_free (GtkCssValue *value) shadow_value_unref (shadow); } - g_slice_free1 (sizeof (GtkCssValue) + sizeof (ShadowValue) * (value->n_shadows - 1), value); + g_free (value); } static GtkCssValue * diff --git a/gtk/gtkcssstringvalue.c b/gtk/gtkcssstringvalue.c index b72427de11..b4cbb8600e 100644 --- a/gtk/gtkcssstringvalue.c +++ b/gtk/gtkcssstringvalue.c @@ -31,7 +31,7 @@ static void gtk_css_value_string_free (GtkCssValue *value) { g_free (value->string); - g_slice_free (GtkCssValue, value); + g_free (value); } static GtkCssValue * diff --git a/gtk/gtkcsstransformvalue.c b/gtk/gtkcsstransformvalue.c index 636fd553cf..80ad89f278 100644 --- a/gtk/gtkcsstransformvalue.c +++ b/gtk/gtkcsstransformvalue.c @@ -266,11 +266,9 @@ gtk_css_value_transform_free (GtkCssValue *value) guint i; for (i = 0; i < value->n_transforms; i++) - { - gtk_css_transform_clear (&value->transforms[i]); - } + gtk_css_transform_clear (&value->transforms[i]); - g_slice_free1 (sizeof (GtkCssValue) + sizeof (GtkCssTransform) * (value->n_transforms - 1), value); + g_free (value); } /* returns TRUE if dest == src */ diff --git a/gtk/gtkcsstransition.c b/gtk/gtkcsstransition.c index 98ef4b2f6a..a17ccc7d63 100644 --- a/gtk/gtkcsstransition.c +++ b/gtk/gtkcsstransition.c @@ -100,8 +100,7 @@ gtk_css_transition_free (GtkStyleAnimation *animation) gtk_css_value_unref (self->start); gtk_css_value_unref (self->ease); - - g_slice_free (GtkCssTransition, self); + g_free (self); } static const GtkStyleAnimationClass GTK_CSS_TRANSITION_CLASS = { @@ -120,7 +119,7 @@ gtk_css_transition_advance (GtkStyleAnimation *style_animation, GtkCssTransition *source = (GtkCssTransition *)style_animation; GtkCssTransition *transition; - transition = g_slice_alloc (sizeof (GtkCssTransition)); + transition = g_new (GtkCssTransition, 1); transition->parent.class = >K_CSS_TRANSITION_CLASS; transition->parent.ref_count = 1; @@ -147,7 +146,7 @@ _gtk_css_transition_new (guint property, g_return_val_if_fail (start != NULL, NULL); g_return_val_if_fail (ease != NULL, NULL); - transition = g_slice_alloc (sizeof (GtkCssTransition)); + transition = g_new (GtkCssTransition, 1); transition->parent.class = >K_CSS_TRANSITION_CLASS; transition->parent.ref_count = 1; diff --git a/gtk/gtkcssvalue.c b/gtk/gtkcssvalue.c index e7f41fdac9..974a355ab5 100644 --- a/gtk/gtkcssvalue.c +++ b/gtk/gtkcssvalue.c @@ -142,7 +142,7 @@ _gtk_css_value_alloc (const GtkCssValueClass *klass, { GtkCssValue *value; - value = g_slice_alloc0 (size); + value = g_malloc0 (size); value->class = klass; value->ref_count = 1; diff --git a/gtk/gtkdrop.c b/gtk/gtkdrop.c index eac5995b1f..ee3788aae8 100644 --- a/gtk/gtkdrop.c +++ b/gtk/gtkdrop.c @@ -36,7 +36,7 @@ gtk_drop_free (gpointer data) { GtkDrop *self = data; - g_slice_free (GtkDrop, self); + g_free (self); } static GtkDrop * @@ -51,7 +51,7 @@ gtk_drop_lookup (GdkDrop *drop) result = g_object_get_qdata (G_OBJECT (drop), drop_quark); if (result == NULL) { - result = g_slice_new0 (GtkDrop); + result = g_new0 (GtkDrop, 1); g_object_set_qdata_full (G_OBJECT (drop), drop_quark, result, gtk_drop_free); } diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 1c0798ff97..d3f676fe4a 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -363,7 +363,7 @@ gtk_entry_buildable_custom_tag_start (GtkBuildable *buildable, { GtkPangoAttributeParserData *parser_data; - parser_data = g_slice_new0 (GtkPangoAttributeParserData); + parser_data = g_new0 (GtkPangoAttributeParserData, 1); parser_data->builder = g_object_ref (builder); parser_data->object = (GObject *) g_object_ref (buildable); *parser = pango_parser; @@ -395,7 +395,7 @@ gtk_entry_buildable_custom_finished (GtkBuildable *buildable, g_object_unref (data->object); g_object_unref (data->builder); - g_slice_free (GtkPangoAttributeParserData, data); + g_free (data); } } @@ -1441,7 +1441,7 @@ gtk_entry_finalize (GObject *object) gtk_widget_unparent (icon_info->widget); - g_slice_free (EntryIconInfo, icon_info); + g_free (icon_info); } g_clear_pointer (&priv->progress_widget, gtk_widget_unparent); @@ -1603,7 +1603,7 @@ construct_icon_info (GtkWidget *widget, g_return_val_if_fail (priv->icons[icon_pos] == NULL, NULL); - icon_info = g_slice_new0 (EntryIconInfo); + icon_info = g_new0 (EntryIconInfo, 1); priv->icons[icon_pos] = icon_info; icon_info->widget = gtk_image_new (); diff --git a/gtk/gtkexpression.c b/gtk/gtkexpression.c index 8750782bdd..a7c4fe711e 100644 --- a/gtk/gtkexpression.c +++ b/gtk/gtkexpression.c @@ -2050,7 +2050,7 @@ free_binds (gpointer data) g_assert (bind->target == NULL); if (bind->watch) gtk_expression_watch_unwatch (bind->watch); - g_slice_free (GtkExpressionBind, bind); + g_free (bind); } g_slist_free (data); } @@ -2070,7 +2070,7 @@ gtk_expression_bind_free (gpointer data) else g_object_weak_unref (bind->target, invalidate_binds, NULL); - g_slice_free (GtkExpressionBind, bind); + g_free (bind); } else { @@ -2154,7 +2154,7 @@ gtk_expression_bind (GtkExpression *self, return NULL; } - bind = g_slice_new0 (GtkExpressionBind); + bind = g_new0 (GtkExpressionBind, 1); binds = g_object_steal_data (target, "gtk-expression-binds"); if (binds == NULL) g_object_weak_ref (target, invalidate_binds, NULL); diff --git a/gtk/gtkfilefilter.c b/gtk/gtkfilefilter.c index 425d8d4ca7..4a18ab050f 100644 --- a/gtk/gtkfilefilter.c +++ b/gtk/gtkfilefilter.c @@ -225,7 +225,7 @@ filter_rule_free (FilterRule *rule) default: break; } - g_slice_free (FilterRule, rule); + g_free (rule); } static void @@ -442,7 +442,7 @@ gtk_file_filter_buildable_custom_tag_start (GtkBuildable *buildable, if (strcmp (tagname, "mime-types") == 0) { - data = g_slice_new0 (SubParserData); + data = g_new0 (SubParserData, 1); data->string = g_string_new (""); data->type = PARSE_MIME_TYPES; data->filter = GTK_FILE_FILTER (buildable); @@ -453,7 +453,7 @@ gtk_file_filter_buildable_custom_tag_start (GtkBuildable *buildable, } else if (strcmp (tagname, "patterns") == 0) { - data = g_slice_new0 (SubParserData); + data = g_new0 (SubParserData, 1); data->string = g_string_new (""); data->type = PARSE_PATTERNS; data->filter = GTK_FILE_FILTER (buildable); @@ -464,7 +464,7 @@ gtk_file_filter_buildable_custom_tag_start (GtkBuildable *buildable, } else if (strcmp (tagname, "suffixes") == 0) { - data = g_slice_new0 (SubParserData); + data = g_new0 (SubParserData, 1); data->string = g_string_new (""); data->type = PARSE_SUFFIXES; data->filter = GTK_FILE_FILTER (buildable); @@ -491,7 +491,7 @@ gtk_file_filter_buildable_custom_tag_end (GtkBuildable *buildable, SubParserData *data = (SubParserData*)user_data; g_string_free (data->string, TRUE); - g_slice_free (SubParserData, data); + g_free (data); } } @@ -621,7 +621,7 @@ gtk_file_filter_add_mime_type (GtkFileFilter *filter, g_return_if_fail (GTK_IS_FILE_FILTER (filter)); g_return_if_fail (mime_type != NULL); - rule = g_slice_new (FilterRule); + rule = g_new (FilterRule, 1); rule->type = FILTER_RULE_MIME_TYPE; rule->u.content_types = g_new0 (char *, 2); rule->u.content_types[0] = g_content_type_from_mime_type (mime_type); @@ -650,7 +650,7 @@ gtk_file_filter_add_pattern (GtkFileFilter *filter, g_return_if_fail (GTK_IS_FILE_FILTER (filter)); g_return_if_fail (pattern != NULL); - rule = g_slice_new (FilterRule); + rule = g_new (FilterRule, 1); rule->type = FILTER_RULE_PATTERN; rule->u.pattern = g_strdup (pattern); @@ -682,7 +682,7 @@ gtk_file_filter_add_suffix (GtkFileFilter *filter, g_return_if_fail (GTK_IS_FILE_FILTER (filter)); g_return_if_fail (suffix != NULL); - rule = g_slice_new (FilterRule); + rule = g_new (FilterRule, 1); rule->type = FILTER_RULE_SUFFIX; rule->u.pattern = g_strconcat ("*.", suffix, NULL); @@ -709,7 +709,7 @@ gtk_file_filter_add_pixbuf_formats (GtkFileFilter *filter) g_return_if_fail (GTK_IS_FILE_FILTER (filter)); - rule = g_slice_new (FilterRule); + rule = g_new (FilterRule, 1); rule->type = FILTER_RULE_PIXBUF_FORMATS; array = g_ptr_array_new (); diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c index c830751642..14354feaaf 100644 --- a/gtk/gtkfilesystemmodel.c +++ b/gtk/gtkfilesystemmodel.c @@ -435,7 +435,7 @@ add_file (GtkFileSystemModel *model, g_return_if_fail (G_IS_FILE (file)); g_return_if_fail (G_IS_FILE_INFO (info)); - node = g_slice_alloc0 (sizeof (FileModelNode)); + node = g_new0 (FileModelNode, 1); node->file = g_object_ref (file); if (info) { @@ -445,7 +445,7 @@ add_file (GtkFileSystemModel *model, node->frozen_add = model->frozen ? TRUE : FALSE; g_array_append_vals (model->files, node, 1); - g_slice_free1 (sizeof (FileModelNode), node); + g_free (node); position = model->files->len - 1; diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index 729f632852..f4191f9a77 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -1857,7 +1857,7 @@ free_unthemed_icon (UnthemedIcon *unthemed_icon) { g_free (unthemed_icon->svg_filename); g_free (unthemed_icon->no_svg_filename); - g_slice_free (UnthemedIcon, unthemed_icon); + g_free (unthemed_icon); } static inline void @@ -1932,7 +1932,7 @@ add_unthemed_icon (GtkIconTheme *self, } else { - unthemed_icon = g_slice_new0 (UnthemedIcon); + unthemed_icon = g_new0 (UnthemedIcon, 1); unthemed_icon->is_resource = is_resource; diff --git a/gtk/gtkkineticscrolling.c b/gtk/gtkkineticscrolling.c index 1f02fe7993..b686525099 100644 --- a/gtk/gtkkineticscrolling.c +++ b/gtk/gtkkineticscrolling.c @@ -91,7 +91,7 @@ gtk_kinetic_scrolling_new (double lower, { GtkKineticScrolling *data; - data = g_slice_new0 (GtkKineticScrolling); + data = g_new0 (GtkKineticScrolling, 1); data->lower = lower; data->upper = upper; data->decel_friction = decel_friction; @@ -155,7 +155,7 @@ gtk_kinetic_scrolling_update_size (GtkKineticScrolling *data, void gtk_kinetic_scrolling_free (GtkKineticScrolling *kinetic) { - g_slice_free (GtkKineticScrolling, kinetic); + g_free (kinetic); } static void diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index ee0c815d93..4798dcb09c 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -661,7 +661,7 @@ gtk_label_buildable_custom_tag_start (GtkBuildable *buildable, { GtkPangoAttributeParserData *parser_data; - parser_data = g_slice_new0 (GtkPangoAttributeParserData); + parser_data = g_new0 (GtkPangoAttributeParserData, 1); parser_data->builder = g_object_ref (builder); parser_data->object = (GObject *) g_object_ref (buildable); *parser = pango_parser; @@ -693,7 +693,7 @@ gtk_label_buildable_custom_finished (GtkBuildable *buildable, g_object_unref (data->object); g_object_unref (data->builder); - g_slice_free (GtkPangoAttributeParserData, data); + g_free (data); } } diff --git a/gtk/gtklevelbar.c b/gtk/gtklevelbar.c index 426f97f465..815fbf392b 100644 --- a/gtk/gtklevelbar.c +++ b/gtk/gtklevelbar.c @@ -204,7 +204,7 @@ static GtkLevelBarOffset * gtk_level_bar_offset_new (const char *name, double value) { - GtkLevelBarOffset *offset = g_slice_new0 (GtkLevelBarOffset); + GtkLevelBarOffset *offset = g_new0 (GtkLevelBarOffset, 1); offset->name = g_strdup (name); offset->value = value; @@ -216,7 +216,7 @@ static void gtk_level_bar_offset_free (GtkLevelBarOffset *offset) { g_free (offset->name); - g_slice_free (GtkLevelBarOffset, offset); + g_free (offset); } static int @@ -766,7 +766,7 @@ gtk_level_bar_buildable_custom_tag_start (GtkBuildable *buildable, if (strcmp (tagname, "offsets") != 0) return FALSE; - data = g_slice_new0 (OffsetsParserData); + data = g_new0 (OffsetsParserData, 1); data->self = GTK_LEVEL_BAR (buildable); data->builder = builder; data->offsets = NULL; @@ -805,7 +805,7 @@ gtk_level_bar_buildable_custom_finished (GtkBuildable *buildable, } g_list_free_full (data->offsets, (GDestroyNotify) gtk_level_bar_offset_free); - g_slice_free (OffsetsParserData, data); + g_free (data); } static void diff --git a/gtk/gtklistitemmanager.c b/gtk/gtklistitemmanager.c index 772b17d471..5da8966a4b 100644 --- a/gtk/gtklistitemmanager.c +++ b/gtk/gtklistitemmanager.c @@ -1413,7 +1413,7 @@ gtk_list_item_tracker_new (GtkListItemManager *self) g_return_val_if_fail (GTK_IS_LIST_ITEM_MANAGER (self), NULL); - tracker = g_slice_new0 (GtkListItemTracker); + tracker = g_new0 (GtkListItemTracker, 1); tracker->position = GTK_INVALID_LIST_POSITION; @@ -1430,7 +1430,7 @@ gtk_list_item_tracker_free (GtkListItemManager *self, self->trackers = g_slist_remove (self->trackers, tracker); - g_slice_free (GtkListItemTracker, tracker); + g_free (tracker); gtk_list_item_manager_ensure_items (self, NULL, G_MAXUINT); diff --git a/gtk/gtkmenutracker.c b/gtk/gtkmenutracker.c index 4fccce4a02..c09997675b 100644 --- a/gtk/gtkmenutracker.c +++ b/gtk/gtkmenutracker.c @@ -377,7 +377,7 @@ gtk_menu_tracker_add_items (GtkMenuTracker *tracker, { GtkMenuTrackerSection *fake_section; - fake_section = g_slice_new0 (GtkMenuTrackerSection); + fake_section = g_new0 (GtkMenuTrackerSection, 1); fake_section->is_fake = TRUE; fake_section->model = g_object_ref (item); fake_section->handler = g_signal_connect (item, "notify::is-visible", @@ -467,7 +467,7 @@ gtk_menu_tracker_section_free (GtkMenuTrackerSection *section) g_slist_free_full (section->items, (GDestroyNotify) gtk_menu_tracker_section_free); g_free (section->action_namespace); g_object_unref (section->model); - g_slice_free (GtkMenuTrackerSection, section); + g_free (section); } static GtkMenuTrackerSection * @@ -480,7 +480,7 @@ gtk_menu_tracker_section_new (GtkMenuTracker *tracker, { GtkMenuTrackerSection *section; - section = g_slice_new0 (GtkMenuTrackerSection); + section = g_new0 (GtkMenuTrackerSection, 1); section->model = g_object_ref (model); section->with_separators = with_separators; section->action_namespace = g_strdup (action_namespace); @@ -560,7 +560,7 @@ gtk_menu_tracker_new (GtkActionObservable *observable, { GtkMenuTracker *tracker; - tracker = g_slice_new (GtkMenuTracker); + tracker = g_new (GtkMenuTracker, 1); tracker->merge_sections = merge_sections; tracker->mac_os_mode = mac_os_mode; tracker->observable = g_object_ref (observable); @@ -611,5 +611,5 @@ gtk_menu_tracker_free (GtkMenuTracker *tracker) { gtk_menu_tracker_section_free (tracker->toplevel); g_object_unref (tracker->observable); - g_slice_free (GtkMenuTracker, tracker); + g_free (tracker); } diff --git a/gtk/gtkmultisorter.c b/gtk/gtkmultisorter.c index ddbdb440cb..1ddf5824df 100644 --- a/gtk/gtkmultisorter.c +++ b/gtk/gtkmultisorter.c @@ -84,7 +84,7 @@ gtk_multi_sort_keys_free (GtkSortKeys *keys) for (i = 0; i < self->n_keys; i++) gtk_sort_keys_unref (self->keys[i].keys); - g_slice_free1 (sizeof (GtkMultiSortKeys) + self->n_keys * sizeof (GtkMultiSortKey), self); + g_free (self); } static int diff --git a/gtk/gtknumericsorter.c b/gtk/gtknumericsorter.c index 4f474ad14d..e029fcf0ec 100644 --- a/gtk/gtknumericsorter.c +++ b/gtk/gtknumericsorter.c @@ -81,7 +81,7 @@ gtk_numeric_sort_keys_free (GtkSortKeys *keys) GtkNumericSortKeys *self = (GtkNumericSortKeys *) keys; gtk_expression_unref (self->expression); - g_slice_free (GtkNumericSortKeys, self); + g_free (self); } #define COMPARE_FUNC(type, name, _a, _b) \ diff --git a/gtk/gtkpapersize.c b/gtk/gtkpapersize.c index 81d13f8633..9a2ef889cd 100644 --- a/gtk/gtkpapersize.c +++ b/gtk/gtkpapersize.c @@ -195,7 +195,7 @@ gtk_paper_size_new_from_info (const PaperInfo *info) { GtkPaperSize *size; - size = g_slice_new0 (GtkPaperSize); + size = g_new0 (GtkPaperSize, 1); size->info = info; size->width = info->width; size->height = info->height; @@ -238,7 +238,7 @@ gtk_paper_size_new (const char *name) } else { - size = g_slice_new0 (GtkPaperSize); + size = g_new0 (GtkPaperSize, 1); size->width = width; size->height = height; @@ -256,7 +256,7 @@ gtk_paper_size_new (const char *name) else { g_warning ("Unknown paper size %s", name); - size = g_slice_new0 (GtkPaperSize); + size = g_new0 (GtkPaperSize, 1); size->name = g_strdup (name); size->display_name = g_strdup (name); /* Default to A4 size */ @@ -484,7 +484,7 @@ gtk_paper_size_new_custom (const char *name, g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (unit != GTK_UNIT_NONE, NULL); - size = g_slice_new0 (GtkPaperSize); + size = g_new0 (GtkPaperSize, 1); size->name = g_strdup (name); size->display_name = g_strdup (display_name); @@ -509,7 +509,7 @@ gtk_paper_size_copy (GtkPaperSize *other) { GtkPaperSize *size; - size = g_slice_new0 (GtkPaperSize); + size = g_new0 (GtkPaperSize, 1); size->info = other->info; if (other->name) @@ -539,8 +539,7 @@ gtk_paper_size_free (GtkPaperSize *size) g_free (size->name); g_free (size->display_name); g_free (size->ppd_name); - - g_slice_free (GtkPaperSize, size); + g_free (size); } /** diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index df34858ac1..ff6558a108 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -825,7 +825,7 @@ on_bookmark_query_info_complete (GObject *source, out: g_clear_object (&info); g_clear_error (&error); - g_slice_free (BookmarkQueryClosure, clos); + g_free (clos); } static gboolean @@ -1365,7 +1365,7 @@ update_places (GtkPlacesSidebar *sidebar) if (_gtk_bookmarks_manager_get_is_builtin (sidebar->bookmarks_manager, root)) continue; - clos = g_slice_new (BookmarkQueryClosure); + clos = g_new (BookmarkQueryClosure, 1); clos->sidebar = sidebar; clos->index = index; clos->is_native = is_native; diff --git a/gtk/gtkrbtree.c b/gtk/gtkrbtree.c index 4ccff54084..befe1cdbc9 100644 --- a/gtk/gtkrbtree.c +++ b/gtk/gtkrbtree.c @@ -117,7 +117,7 @@ gtk_rb_node_new (GtkRbTree *tree) { GtkRbNode *result; - result = g_slice_alloc0 (gtk_rb_node_get_size (tree)); + result = g_malloc0 (gtk_rb_node_get_size (tree)); result->red = TRUE; result->dirty = TRUE; @@ -134,7 +134,7 @@ gtk_rb_node_free (GtkRbTree *tree, if (tree->clear_augment_func) tree->clear_augment_func (NODE_TO_AUG_POINTER (tree, node)); - g_slice_free1 (gtk_rb_node_get_size (tree), node); + g_free (node); } static void @@ -511,7 +511,7 @@ gtk_rb_tree_new_for_size (gsize element_size, { GtkRbTree *tree; - tree = g_slice_new0 (GtkRbTree); + tree = g_new0 (GtkRbTree, 1); tree->ref_count = 1; tree->element_size = element_size; @@ -540,8 +540,8 @@ gtk_rb_tree_unref (GtkRbTree *tree) if (tree->root) gtk_rb_node_free_deep (tree, tree->root); - - g_slice_free (GtkRbTree, tree); + + g_free (tree); } gpointer diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c index d1201f8815..9fbd2e17cd 100644 --- a/gtk/gtkscale.c +++ b/gtk/gtkscale.c @@ -1834,7 +1834,7 @@ mark_data_free (MarkData *data) { g_string_free (data->markup, TRUE); g_free (data->context); - g_slice_free (MarkData, data); + g_free (data); } static void @@ -1908,7 +1908,7 @@ marks_start_element (GtkBuildableParseContext *context, position = g_value_get_enum (&gvalue); } - mark = g_slice_new (MarkData); + mark = g_new (MarkData, 1); mark->value = value; if (position == GTK_POS_LEFT || position == GTK_POS_TOP) mark->position = GTK_POS_TOP; @@ -1968,7 +1968,7 @@ gtk_scale_buildable_custom_tag_start (GtkBuildable *buildable, if (strcmp (tagname, "marks") == 0) { - data = g_slice_new0 (MarksSubparserData); + data = g_new0 (MarksSubparserData, 1); data->scale = GTK_SCALE (buildable); data->builder = builder; data->marks = NULL; @@ -2017,12 +2017,12 @@ gtk_scale_buildable_custom_finished (GtkBuildable *buildable, } g_slist_free (marks_data->marks); - g_slice_free (MarksSubparserData, marks_data); + g_free (marks_data); } else { parent_buildable_iface->custom_finished (buildable, builder, child, - tagname, user_data); + tagname, user_data); } } diff --git a/gtk/gtksearchenginetracker3.c b/gtk/gtksearchenginetracker3.c index bc10e4db03..fc3305dc34 100644 --- a/gtk/gtksearchenginetracker3.c +++ b/gtk/gtksearchenginetracker3.c @@ -125,7 +125,7 @@ free_hit (gpointer data) g_clear_object (&hit->file); g_clear_object (&hit->info); - g_slice_free (GtkSearchHit, hit); + g_free (hit); } static GFileInfo * @@ -194,7 +194,7 @@ handle_cursor_idle_cb (gpointer user_data) break; url = tracker_sparql_cursor_get_string (cursor, 0, NULL); - hit = g_slice_new0 (GtkSearchHit); + hit = g_new0 (GtkSearchHit, 1); hit->file = g_file_new_for_uri (url); hit->info = create_file_info (hit->file, cursor); hits = g_list_prepend (hits, hit); diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c index 2bd42f2972..378089a276 100644 --- a/gtk/gtksettings.c +++ b/gtk/gtksettings.c @@ -1321,7 +1321,7 @@ free_value (gpointer data) g_value_unset (&qvalue->value); g_free (qvalue->origin); - g_slice_free (GtkSettingsValue, qvalue); + g_free (qvalue); } static void @@ -1352,7 +1352,7 @@ gtk_settings_set_property_value_internal (GtkSettings *settings, qvalue = g_datalist_id_dup_data (&settings->queued_settings, name_quark, NULL, NULL); if (!qvalue) { - qvalue = g_slice_new0 (GtkSettingsValue); + qvalue = g_new0 (GtkSettingsValue, 1); g_datalist_id_set_data_full (&settings->queued_settings, name_quark, qvalue, free_value); } else diff --git a/gtk/gtksizegroup.c b/gtk/gtksizegroup.c index 6dba79ae18..916e5155d5 100644 --- a/gtk/gtksizegroup.c +++ b/gtk/gtksizegroup.c @@ -531,7 +531,7 @@ gtk_size_group_buildable_custom_tag_start (GtkBuildable *buildable, if (strcmp (tagname, "widgets") == 0) { - data = g_slice_new0 (GSListSubParserData); + data = g_new0 (GSListSubParserData, 1); data->items = NULL; data->object = G_OBJECT (buildable); data->builder = builder; @@ -571,5 +571,5 @@ gtk_size_group_buildable_custom_finished (GtkBuildable *buildable, gtk_size_group_add_widget (GTK_SIZE_GROUP (data->object), GTK_WIDGET (object)); } g_slist_free_full (data->items, item_data_free); - g_slice_free (GSListSubParserData, data); + g_free (data); } diff --git a/gtk/gtksizerequestcache.c b/gtk/gtksizerequestcache.c index 49e5e9d5d0..434db3b0d4 100644 --- a/gtk/gtksizerequestcache.c +++ b/gtk/gtksizerequestcache.c @@ -37,9 +37,9 @@ free_sizes_x (SizeRequestX **sizes) int i; for (i = 0; i < GTK_SIZE_REQUEST_CACHED_SIZES && sizes[i] != NULL; i++) - g_slice_free (SizeRequestX, sizes[i]); + g_free (sizes[i]); - g_slice_free1 (sizeof (SizeRequestY *) * GTK_SIZE_REQUEST_CACHED_SIZES, sizes); + g_free (sizes); } static void @@ -48,9 +48,9 @@ free_sizes_y (SizeRequestY **sizes) int i; for (i = 0; i < GTK_SIZE_REQUEST_CACHED_SIZES && sizes[i] != NULL; i++) - g_slice_free (SizeRequestY, sizes[i]); + g_free (sizes[i]); - g_slice_free1 (sizeof (SizeRequestY *) * GTK_SIZE_REQUEST_CACHED_SIZES, sizes); + g_free (sizes); } void @@ -144,10 +144,10 @@ _gtk_size_request_cache_commit (SizeRequestCache *cache, } if (cache->requests_x == NULL) - cache->requests_x = g_slice_alloc0 (sizeof (SizeRequestX *) * GTK_SIZE_REQUEST_CACHED_SIZES); + cache->requests_x = g_new0 (SizeRequestX *, GTK_SIZE_REQUEST_CACHED_SIZES); if (cache->requests_x[cache->flags[orientation].last_cached_request] == NULL) - cache->requests_x[cache->flags[orientation].last_cached_request] = g_slice_new (SizeRequestX); + cache->requests_x[cache->flags[orientation].last_cached_request] = g_new (SizeRequestX, 1); cached_size = cache->requests_x[cache->flags[orientation].last_cached_request]; cached_size->lower_for_size = for_size; @@ -188,10 +188,10 @@ _gtk_size_request_cache_commit (SizeRequestCache *cache, } if (cache->requests_y == NULL) - cache->requests_y = g_slice_alloc0 (sizeof (SizeRequestY *) * GTK_SIZE_REQUEST_CACHED_SIZES); + cache->requests_y = g_new0 (SizeRequestY *, GTK_SIZE_REQUEST_CACHED_SIZES); if (cache->requests_y[cache->flags[orientation].last_cached_request] == NULL) - cache->requests_y[cache->flags[orientation].last_cached_request] = g_slice_new (SizeRequestY); + cache->requests_y[cache->flags[orientation].last_cached_request] = g_new (SizeRequestY, 1); cached_size = cache->requests_y[cache->flags[orientation].last_cached_request]; cached_size->lower_for_size = for_size; diff --git a/gtk/gtksorter.c b/gtk/gtksorter.c index 2de29554ec..152eccd4ac 100644 --- a/gtk/gtksorter.c +++ b/gtk/gtksorter.c @@ -236,7 +236,7 @@ gtk_default_sort_keys_free (GtkSortKeys *keys) g_object_unref (self->sorter); - g_slice_free (GtkDefaultSortKeys, self); + g_free (self); } static gboolean diff --git a/gtk/gtksortkeys.c b/gtk/gtksortkeys.c index 9aa7a3f689..1e65b23e7f 100644 --- a/gtk/gtksortkeys.c +++ b/gtk/gtksortkeys.c @@ -32,7 +32,7 @@ gtk_sort_keys_alloc (const GtkSortKeysClass *klass, g_return_val_if_fail (key_align > 0, NULL); - self = g_slice_alloc0 (size); + self = g_malloc0 (size); self->klass = klass; self->ref_count = 1; @@ -98,7 +98,7 @@ gtk_sort_keys_needs_clear_key (GtkSortKeys *self) static void gtk_equal_sort_keys_free (GtkSortKeys *keys) { - g_slice_free (GtkSortKeys, keys); + g_free (keys); } static int diff --git a/gtk/gtkstringlist.c b/gtk/gtkstringlist.c index ffd3d5c61e..d7e7be3f81 100644 --- a/gtk/gtkstringlist.c +++ b/gtk/gtkstringlist.c @@ -361,7 +361,7 @@ gtk_string_list_buildable_custom_tag_start (GtkBuildable *buildable, { ItemParserData *data; - data = g_slice_new0 (ItemParserData); + data = g_new0 (ItemParserData, 1); data->builder = g_object_ref (builder); data->list = g_object_ref (GTK_STRING_LIST (buildable)); data->domain = gtk_builder_get_translation_domain (builder); @@ -391,7 +391,7 @@ gtk_string_list_buildable_custom_finished (GtkBuildable *buildable, g_object_unref (data->list); g_object_unref (data->builder); g_string_free (data->string, TRUE); - g_slice_free (ItemParserData, data); + g_free (data); } } diff --git a/gtk/gtkstringsorter.c b/gtk/gtkstringsorter.c index ed2a0ac34c..15866b9304 100644 --- a/gtk/gtkstringsorter.c +++ b/gtk/gtkstringsorter.c @@ -163,7 +163,7 @@ gtk_string_sort_keys_free (GtkSortKeys *keys) GtkStringSortKeys *self = (GtkStringSortKeys *) keys; gtk_expression_unref (self->expression); - g_slice_free (GtkStringSortKeys, self); + g_free (self); } static int diff --git a/gtk/gtktext.c b/gtk/gtktext.c index 53335ced05..5c1e705604 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -3576,7 +3576,7 @@ gtk_text_password_hint_free (GtkTextPasswordHint *password_hint) if (password_hint->source_id) g_source_remove (password_hint->source_id); - g_slice_free (GtkTextPasswordHint, password_hint); + g_free (password_hint); } @@ -3645,7 +3645,7 @@ buffer_inserted_text (GtkEntryBuffer *buffer, quark_password_hint); if (!password_hint) { - password_hint = g_slice_new0 (GtkTextPasswordHint); + password_hint = g_new0 (GtkTextPasswordHint, 1); g_object_set_qdata_full (G_OBJECT (self), quark_password_hint, password_hint, (GDestroyNotify)gtk_text_password_hint_free); } diff --git a/gtk/gtktextattributes.c b/gtk/gtktextattributes.c index d8cef2518e..015bdd11c5 100644 --- a/gtk/gtktextattributes.c +++ b/gtk/gtktextattributes.c @@ -66,7 +66,7 @@ gtk_text_attributes_new (void) { GtkTextAttributes *values; - values = g_slice_new0 (GtkTextAttributes); + values = g_new0 (GtkTextAttributes, 1); /* 0 is a valid value for most of the struct */ values->refcount = 1; @@ -244,7 +244,7 @@ gtk_text_attributes_unref (GtkTextAttributes *values) if (values->font_features) g_free (values->font_features); - g_slice_free (GtkTextAttributes, values); + g_free (values); } } diff --git a/gtk/gtktextbtree.c b/gtk/gtktextbtree.c index 15910f47e5..78f07bcffc 100644 --- a/gtk/gtktextbtree.c +++ b/gtk/gtktextbtree.c @@ -395,7 +395,7 @@ _gtk_text_btree_new (GtkTextTagTable *table, /* Create the tree itself */ - tree = g_slice_new0 (GtkTextBTree); + tree = g_new0 (GtkTextBTree, 1); tree->root_node = root_node; tree->table = table; tree->views = NULL; @@ -513,7 +513,7 @@ _gtk_text_btree_unref (GtkTextBTree *tree) g_object_unref (tree->selection_bound_mark); tree->selection_bound_mark = NULL; - g_slice_free (GtkTextBTree, tree); + g_free (tree); } } @@ -1539,7 +1539,7 @@ _gtk_text_btree_add_view (GtkTextBTree *tree, g_return_if_fail (tree != NULL); - view = g_slice_new (BTreeView); + view = g_new (BTreeView, 1); view->view_id = layout; view->layout = layout; @@ -1561,7 +1561,7 @@ _gtk_text_btree_add_view (GtkTextBTree *tree, */ last_line = get_last_line (tree); - line_data = g_slice_new (GtkTextLineData); + line_data = g_new (GtkTextLineData, 1); line_data->view_id = layout; line_data->next = NULL; line_data->width = 0; @@ -1607,14 +1607,14 @@ _gtk_text_btree_remove_view (GtkTextBTree *tree, */ last_line = get_last_line (tree); line_data = _gtk_text_line_remove_data (last_line, view_id); - g_slice_free (GtkTextLineData, line_data); + g_free (line_data); gtk_text_btree_node_remove_view (view, tree->root_node, view_id); view->layout = (gpointer) 0xdeadbeef; view->view_id = (gpointer) 0xdeadbeef; - g_slice_free (BTreeView, view); + g_free (view); } void @@ -1665,7 +1665,7 @@ static IterStack* iter_stack_new (void) { IterStack *stack; - stack = g_slice_new (IterStack); + stack = g_new (IterStack, 1); stack->iters = NULL; stack->count = 0; stack->allocated = 0; @@ -1704,7 +1704,7 @@ static void iter_stack_free (IterStack *stack) { g_free (stack->iters); - g_slice_free (IterStack, stack); + g_free (stack); } static void @@ -3610,7 +3610,7 @@ _gtk_text_line_data_new (GtkTextLayout *layout, { GtkTextLineData *line_data; - line_data = g_slice_new (GtkTextLineData); + line_data = g_new (GtkTextLineData, 1); line_data->view_id = layout; line_data->next = NULL; @@ -4700,7 +4700,12 @@ _gtk_text_line_previous_could_contain_tag (GtkTextLine *line, static void summary_list_destroy (Summary *summary) { - g_slice_free_chain (Summary, summary, next); + while (summary) + { + Summary *next = summary->next; + g_free (summary); + summary = next; + } } static GtkTextLine* @@ -4734,7 +4739,7 @@ gtk_text_line_new (void) { GtkTextLine *line; - line = g_slice_new0 (GtkTextLine); + line = g_new0 (GtkTextLine, 1); line->dir_strong = PANGO_DIRECTION_NEUTRAL; line->dir_propagated_forward = PANGO_DIRECTION_NEUTRAL; line->dir_propagated_back = PANGO_DIRECTION_NEUTRAL; @@ -4765,7 +4770,7 @@ gtk_text_line_destroy (GtkTextBTree *tree, GtkTextLine *line) ld = next; } - g_slice_free (GtkTextLine, line); + g_free (line); } static void @@ -4826,7 +4831,7 @@ node_data_new (gpointer view_id, { NodeData *nd; - nd = g_slice_new (NodeData); + nd = g_new (NodeData, 1); nd->view_id = view_id; nd->next = next; @@ -4840,13 +4845,18 @@ node_data_new (gpointer view_id, static inline void node_data_destroy (NodeData *nd) { - g_slice_free (NodeData, nd); + g_free (nd); } static inline void node_data_list_destroy (NodeData *nd) { - g_slice_free_chain (NodeData, nd, next); + while (nd) + { + NodeData *next = nd->next; + g_free (nd); + nd = next; + } } static inline NodeData* @@ -4869,7 +4879,7 @@ summary_destroy (Summary *summary) summary->info = (void*)0x1; summary->toggle_count = 567; summary->next = (void*)0x1; - g_slice_free (Summary, summary); + g_free (summary); } static GtkTextBTreeNode* @@ -4877,7 +4887,7 @@ gtk_text_btree_node_new (void) { GtkTextBTreeNode *node; - node = g_slice_new (GtkTextBTreeNode); + node = g_new (GtkTextBTreeNode, 1); node->node_data = NULL; @@ -4907,7 +4917,7 @@ gtk_text_btree_node_adjust_toggle_count (GtkTextBTreeNode *node, { /* didn't find a summary for our tag. */ g_return_if_fail (adjust > 0); - summary = g_slice_new (Summary); + summary = g_new (Summary, 1); summary->info = info; summary->toggle_count = adjust; summary->next = node->summary; @@ -5529,7 +5539,7 @@ gtk_text_btree_node_free_empty (GtkTextBTree *tree, summary_list_destroy (node->summary); node_data_list_destroy (node->node_data); - g_slice_free (GtkTextBTreeNode, node); + g_free (node); } static NodeData* @@ -6014,7 +6024,7 @@ gtk_text_btree_get_tag_info (GtkTextBTree *tree, { /* didn't find it, create. */ - info = g_slice_new (GtkTextTagInfo); + info = g_new (GtkTextTagInfo, 1); info->tag = tag; g_object_ref (tag); @@ -6055,7 +6065,7 @@ gtk_text_btree_remove_tag_info (GtkTextBTree *tree, g_object_unref (info->tag); - g_slice_free (GtkTextTagInfo, info); + g_free (info); return; } @@ -6355,7 +6365,7 @@ _gtk_change_node_toggle_count (GtkTextBTreeNode *node, */ GtkTextBTreeNode *rootnode = info->tag_root; - summary = g_slice_new (Summary); + summary = g_new (Summary, 1); summary->info = info; summary->toggle_count = info->toggle_count - delta; summary->next = rootnode->summary; @@ -6364,7 +6374,7 @@ _gtk_change_node_toggle_count (GtkTextBTreeNode *node, rootLevel = rootnode->level; info->tag_root = rootnode; } - summary = g_slice_new (Summary); + summary = g_new (Summary, 1); summary->info = info; summary->toggle_count = delta; summary->next = node->summary; diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c index a8a7b774dc..09bb01c7d5 100644 --- a/gtk/gtktextbuffer.c +++ b/gtk/gtktextbuffer.c @@ -1404,7 +1404,7 @@ save_range (GtkTextIter *range_start, { Range *r; - r = g_slice_new (Range); + r = g_new (Range, 1); r->buffer = gtk_text_iter_get_buffer (range_start); g_object_ref (r->buffer); @@ -1464,7 +1464,7 @@ restore_range (Range *r) *r->range_end = *r->whole_end; g_object_unref (r->buffer); - g_slice_free (Range, r); + g_free (r); } static void @@ -3662,7 +3662,7 @@ static void free_clipboard_request (ClipboardRequest *request_data) { g_object_unref (request_data->buffer); - g_slice_free (ClipboardRequest, request_data); + g_free (request_data); } #if 0 @@ -3854,7 +3854,7 @@ gtk_text_buffer_add_selection_clipboard (GtkTextBuffer *buffer, } else { - selection_clipboard = g_slice_new (SelectionClipboard); + selection_clipboard = g_new (SelectionClipboard, 1); selection_clipboard->clipboard = clipboard; selection_clipboard->ref_count = 1; @@ -3897,7 +3897,7 @@ gtk_text_buffer_remove_selection_clipboard (GtkTextBuffer *buffer, buffer->priv->selection_clipboards = g_slist_remove (buffer->priv->selection_clipboards, selection_clipboard); - g_slice_free (SelectionClipboard, selection_clipboard); + g_free (selection_clipboard); } } @@ -3910,7 +3910,7 @@ remove_all_selection_clipboards (GtkTextBuffer *buffer) for (l = priv->selection_clipboards; l != NULL; l = l->next) { SelectionClipboard *selection_clipboard = l->data; - g_slice_free (SelectionClipboard, selection_clipboard); + g_free (selection_clipboard); } g_slist_free (priv->selection_clipboards); @@ -3940,7 +3940,7 @@ gtk_text_buffer_paste_clipboard (GtkTextBuffer *buffer, GtkTextIter *override_location, gboolean default_editable) { - ClipboardRequest *data = g_slice_new (ClipboardRequest); + ClipboardRequest *data = g_new (ClipboardRequest, 1); GtkTextIter paste_point; GtkTextIter start, end; @@ -4321,7 +4321,7 @@ free_log_attr_cache (GtkTextLogAttrCache *cache) for (i = 0; i < ATTR_CACHE_SIZE; i++) g_free (cache->entries[i].attrs); - g_slice_free (GtkTextLogAttrCache, cache); + g_free (cache); } static void @@ -4398,7 +4398,7 @@ _gtk_text_buffer_get_line_log_attrs (GtkTextBuffer *buffer, if (priv->log_attr_cache == NULL) { - priv->log_attr_cache = g_slice_new0 (GtkTextLogAttrCache); + priv->log_attr_cache = g_new0 (GtkTextLogAttrCache, 1); priv->log_attr_cache->chars_changed_stamp = _gtk_text_btree_get_chars_changed_stamp (get_btree (buffer)); } diff --git a/gtk/gtktextchild.c b/gtk/gtktextchild.c index b3ca5908f6..a7d2fa1860 100644 --- a/gtk/gtktextchild.c +++ b/gtk/gtktextchild.c @@ -142,7 +142,7 @@ paintable_segment_delete_func (GtkTextLineSegment *seg, g_object_unref (paintable); } - g_slice_free1 (PAINTABLE_SEG_SIZE, seg); + g_free (seg); return 0; } @@ -184,7 +184,7 @@ _gtk_paintable_segment_new (GdkPaintable *paintable) GtkTextLineSegment *seg; guint flags; - seg = g_slice_alloc (PAINTABLE_SEG_SIZE); + seg = g_malloc (PAINTABLE_SEG_SIZE); seg->type = >k_text_paintable_type; @@ -299,7 +299,7 @@ _gtk_widget_segment_new (GtkTextChildAnchor *anchor) GtkTextLineSegment *seg; GtkTextChildAnchorPrivate *priv = gtk_text_child_anchor_get_instance_private (anchor); - seg = g_slice_alloc (WIDGET_SEG_SIZE); + seg = g_malloc (WIDGET_SEG_SIZE); seg->type = >k_text_child_type; @@ -461,7 +461,7 @@ gtk_text_child_anchor_finalize (GObject *obj) g_slist_free_full (seg->body.child.widgets, g_object_unref); - g_slice_free1 (WIDGET_SEG_SIZE, seg); + g_free (seg); } g_free (priv->replacement); diff --git a/gtk/gtktexthistory.c b/gtk/gtktexthistory.c index 614724112a..8cd6f85e91 100644 --- a/gtk/gtktexthistory.c +++ b/gtk/gtktexthistory.c @@ -285,7 +285,7 @@ action_new (ActionKind kind) { Action *action; - action = g_slice_new0 (Action); + action = g_new0 (Action, 1); action->kind = kind; action->link.data = action; @@ -305,7 +305,7 @@ action_free (Action *action) else if (action->kind == ACTION_KIND_GROUP) clear_action_queue (&action->u.group.actions); - g_slice_free (Action, action); + g_free (action); } static gboolean diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c index 9ffbf581a3..d3b18752c4 100644 --- a/gtk/gtktextiter.c +++ b/gtk/gtktextiter.c @@ -425,7 +425,7 @@ gtk_text_iter_copy (const GtkTextIter *iter) g_return_val_if_fail (iter != NULL, NULL); - new_iter = g_slice_new (GtkTextIter); + new_iter = g_new (GtkTextIter, 1); *new_iter = *iter; @@ -447,7 +447,7 @@ gtk_text_iter_free (GtkTextIter *iter) { g_return_if_fail (iter != NULL); - g_slice_free (GtkTextIter, iter); + g_free (iter); } /** diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c index 0162c266f1..7e6915cc22 100644 --- a/gtk/gtktextlayout.c +++ b/gtk/gtktextlayout.c @@ -854,7 +854,7 @@ gtk_text_layout_free_line_data (GtkTextLayout *layout, { gtk_text_layout_invalidate_cache (layout, line, FALSE); - g_slice_free (GtkTextLineData, line_data); + g_free (line_data); } /** @@ -1348,7 +1348,7 @@ gtk_text_attr_appearance_destroy (PangoAttribute *attr) if (appearance_attr->appearance.strikethrough_rgba) gdk_rgba_free (appearance_attr->appearance.strikethrough_rgba); - g_slice_free (GtkTextAttrAppearance, appearance_attr); + g_free (appearance_attr); } static gboolean @@ -1431,7 +1431,7 @@ gtk_text_attr_appearance_new (const GtkTextAppearance *appearance) klass.type = gtk_text_attr_appearance_type = pango_attr_type_register (I_("GtkTextAttrAppearance")); - result = g_slice_new (GtkTextAttrAppearance); + result = g_new (GtkTextAttrAppearance, 1); result->attr.klass = &klass; result->appearance = *appearance; diff --git a/gtk/gtktextlinedisplaycache.c b/gtk/gtktextlinedisplaycache.c index 614b4d1e42..c99ef06d01 100644 --- a/gtk/gtktextlinedisplaycache.c +++ b/gtk/gtktextlinedisplaycache.c @@ -77,7 +77,7 @@ gtk_text_line_display_cache_new (void) { GtkTextLineDisplayCache *ret; - ret = g_slice_new0 (GtkTextLineDisplayCache); + ret = g_new0 (GtkTextLineDisplayCache, 1); ret->sorted_by_line = g_sequence_new ((GDestroyNotify)gtk_text_line_display_unref); ret->line_to_display = g_hash_table_new (NULL, NULL); ret->mru_size = DEFAULT_MRU_SIZE; @@ -101,7 +101,7 @@ gtk_text_line_display_cache_free (GtkTextLineDisplayCache *cache) g_clear_pointer (&cache->evict_source, g_source_destroy); g_clear_pointer (&cache->sorted_by_line, g_sequence_free); g_clear_pointer (&cache->line_to_display, g_hash_table_unref); - g_slice_free (GtkTextLineDisplayCache, cache); + g_free (cache); } static gboolean diff --git a/gtk/gtktextmark.c b/gtk/gtktextmark.c index f1c5edb4be..665079e62f 100644 --- a/gtk/gtktextmark.c +++ b/gtk/gtktextmark.c @@ -176,7 +176,7 @@ gtk_text_mark_finalize (GObject *obj) "impending"); g_free (seg->body.mark.name); - g_slice_free1 (MSEG_SIZE, seg); + g_free (seg); mark->segment = NULL; } @@ -383,7 +383,7 @@ gtk_mark_segment_new (GtkTextMark *mark_obj) { GtkTextLineSegment *mark; - mark = g_slice_alloc0 (MSEG_SIZE); + mark = g_malloc0 (MSEG_SIZE); mark->body.mark.name = NULL; mark->type = >k_text_right_mark_type; diff --git a/gtk/gtktextsegment.c b/gtk/gtktextsegment.c index e243b5a267..233016346f 100644 --- a/gtk/gtktextsegment.c +++ b/gtk/gtktextsegment.c @@ -193,7 +193,7 @@ _gtk_char_segment_new (const char *text, guint len) g_assert (gtk_text_byte_begins_utf8_char (text)); - seg = g_slice_alloc (CSEG_SIZE (len)); + seg = g_malloc (CSEG_SIZE (len)); seg->type = (GtkTextLineSegmentClass *)>k_text_char_type; seg->next = NULL; seg->byte_count = len; @@ -221,7 +221,7 @@ _gtk_char_segment_new_from_two_strings (const char *text1, g_assert (gtk_text_byte_begins_utf8_char (text1)); g_assert (gtk_text_byte_begins_utf8_char (text2)); - seg = g_slice_alloc (CSEG_SIZE (len1+len2)); + seg = g_malloc (CSEG_SIZE (len1+len2)); seg->type = >k_text_char_type; seg->next = NULL; seg->byte_count = len1 + len2; @@ -245,7 +245,7 @@ _gtk_char_segment_free (GtkTextLineSegment *seg) g_assert (seg->type == >k_text_char_type); - g_slice_free1 (CSEG_SIZE (seg->byte_count), seg); + g_free (seg); } /* @@ -433,7 +433,7 @@ _gtk_toggle_segment_new (GtkTextTagInfo *info, gboolean on) #pragma GCC diagnostic ignored "-Warray-bounds" GtkTextLineSegment *seg; - seg = g_slice_alloc (TSEG_SIZE); + seg = g_malloc (TSEG_SIZE); seg->type = on ? >k_text_toggle_on_type : >k_text_toggle_off_type; @@ -458,7 +458,7 @@ _gtk_toggle_segment_free (GtkTextLineSegment *seg) g_assert (seg->type == >k_text_toggle_on_type || seg->type == >k_text_toggle_off_type); - g_slice_free1 (TSEG_SIZE, seg); + g_free (seg); } /* diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 271f642294..ccc83bc527 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -2738,7 +2738,7 @@ free_pending_scroll (GtkTextPendingScroll *scroll) gtk_text_buffer_delete_mark (gtk_text_mark_get_buffer (scroll->mark), scroll->mark); g_object_unref (scroll->mark); - g_slice_free (GtkTextPendingScroll, scroll); + g_free (scroll); } static void @@ -2764,7 +2764,7 @@ gtk_text_view_queue_scroll (GtkTextView *text_view, DV(g_print(G_STRLOC"\n")); - scroll = g_slice_new (GtkTextPendingScroll); + scroll = g_new (GtkTextPendingScroll, 1); scroll->within_margin = within_margin; scroll->use_align = use_align; @@ -7410,7 +7410,7 @@ selection_data_free (SelectionData *data) g_object_unref (data->buffer); - g_slice_free (SelectionData, data); + g_free (data); } static gboolean @@ -7642,7 +7642,7 @@ gtk_text_view_start_selection_drag (GtkTextView *text_view, SelectionData *data; priv = text_view->priv; - data = g_slice_new0 (SelectionData); + data = g_new0 (SelectionData, 1); data->granularity = granularity; buffer = get_buffer (text_view); @@ -9403,7 +9403,7 @@ text_window_new (GtkWidget *widget) GtkTextWindow *win; GtkCssNode *widget_node; - win = g_slice_new (GtkTextWindow); + win = g_new (GtkTextWindow, 1); win->type = GTK_TEXT_WINDOW_TEXT; win->widget = widget; @@ -9429,7 +9429,7 @@ text_window_free (GtkTextWindow *win) { gtk_css_node_set_parent (win->css_node, NULL); - g_slice_free (GtkTextWindow, win); + g_free (win); } static void @@ -9588,7 +9588,7 @@ anchored_child_new (GtkWidget *child, { AnchoredChild *vc; - vc = g_slice_new0 (AnchoredChild); + vc = g_new0 (AnchoredChild, 1); vc->link.data = vc; vc->widget = g_object_ref (child); vc->anchor = g_object_ref (anchor); @@ -9615,7 +9615,7 @@ anchored_child_free (AnchoredChild *child) g_object_unref (child->anchor); g_object_unref (child->widget); - g_slice_free (AnchoredChild, child); + g_free (child); } static void diff --git a/gtk/gtktextviewchild.c b/gtk/gtktextviewchild.c index e3ae004801..4532b99910 100644 --- a/gtk/gtktextviewchild.c +++ b/gtk/gtktextviewchild.c @@ -60,7 +60,7 @@ overlay_new (GtkWidget *widget, { Overlay *overlay; - overlay = g_slice_new0 (Overlay); + overlay = g_new0 (Overlay, 1); overlay->link.data = overlay; overlay->widget = g_object_ref (widget); overlay->x = x; @@ -76,7 +76,7 @@ overlay_free (Overlay *overlay) g_assert (overlay->link.next == NULL); g_object_unref (overlay->widget); - g_slice_free (Overlay, overlay); + g_free (overlay); } static void diff --git a/gtk/gtktreelistrowsorter.c b/gtk/gtktreelistrowsorter.c index d7932cb067..2afdf72d25 100644 --- a/gtk/gtktreelistrowsorter.c +++ b/gtk/gtktreelistrowsorter.c @@ -112,7 +112,7 @@ gtk_tree_list_row_sort_keys_free (GtkSortKeys *keys) g_hash_table_unref (self->cached_keys); if (self->sort_keys) gtk_sort_keys_unref (self->sort_keys); - g_slice_free (GtkTreeListRowSortKeys, self); + g_free (self); } static inline gboolean diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 974e126172..eaf7f04d11 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -1928,7 +1928,7 @@ template_child_class_free (AutomaticChildClass *child_class) if (child_class) { g_free (child_class->name); - g_slice_free (AutomaticChildClass, child_class); + g_free (child_class); } } @@ -1944,7 +1944,7 @@ gtk_widget_base_class_finalize (GtkWidgetClass *klass) g_object_unref (template_data->scope); - g_slice_free (GtkWidgetTemplate, template_data); + g_free (template_data); } g_object_unref (klass->priv->shortcuts); @@ -2913,7 +2913,7 @@ unref_tick_callback_info (GtkWidget *widget, priv->tick_callbacks = g_list_delete_link (priv->tick_callbacks, link); if (info->notify) info->notify (info->user_data); - g_slice_free (GtkTickCallbackInfo, info); + g_free (info); } if (priv->tick_callbacks == NULL && priv->clock_tick_id) @@ -3045,7 +3045,7 @@ gtk_widget_add_tick_callback (GtkWidget *widget, } } - info = g_slice_new0 (GtkTickCallbackInfo); + info = g_new0 (GtkTickCallbackInfo, 1); info->refcount = 1; info->id = ++tick_callback_id; @@ -3111,7 +3111,7 @@ surface_transform_changed_callback_info_destroy (GtkSurfaceTransformChangedCallb if (info->notify) info->notify (info->user_data); - g_slice_free (GtkSurfaceTransformChangedCallbackInfo, info); + g_free (info); } static void @@ -3158,7 +3158,7 @@ destroy_surface_transform_data (GtkWidget *widget) g_list_free_full (surface_transform_data->callbacks, (GDestroyNotify) surface_transform_changed_callback_info_destroy); - g_slice_free (GtkWidgetSurfaceTransformData, surface_transform_data); + g_free (surface_transform_data); priv->surface_transform_data = NULL; } @@ -3264,7 +3264,7 @@ ensure_surface_transform_data (GtkWidget *widget) GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget); if (!priv->surface_transform_data) - priv->surface_transform_data = g_slice_new0 (GtkWidgetSurfaceTransformData); + priv->surface_transform_data = g_new0 (GtkWidgetSurfaceTransformData, 1); return priv->surface_transform_data; } @@ -3306,7 +3306,7 @@ gtk_widget_add_surface_transform_changed_callback (GtkWidget if (!surface_transform_data->callbacks) sync_widget_surface_transform (widget); - info = g_slice_new0 (GtkSurfaceTransformChangedCallbackInfo); + info = g_new0 (GtkSurfaceTransformChangedCallbackInfo, 1); info->id = ++surface_transform_changed_callback_id; info->callback = callback; @@ -3361,7 +3361,7 @@ gtk_widget_remove_surface_transform_changed_callback (GtkWidget *widget, { if (surface_transform_data->tracked_parent) remove_parent_surface_transform_changed_listener (widget); - g_slice_free (GtkWidgetSurfaceTransformData, surface_transform_data); + g_free (surface_transform_data); priv->surface_transform_data = NULL; } } @@ -7509,7 +7509,7 @@ gtk_widget_real_destroy (GtkWidget *object) child_class->name); if (G_IS_OBJECT (child_object)) { - FinalizeAssertion *assertion = g_slice_new0 (FinalizeAssertion); + FinalizeAssertion *assertion = g_new0 (FinalizeAssertion, 1); assertion->child_class = child_class; assertion->widget_type = class_type; assertion->object = child_object; @@ -7582,7 +7582,7 @@ gtk_widget_real_destroy (GtkWidget *object) g_type_name (assertion->widget_type), assertion->object->ref_count); - g_slice_free (FinalizeAssertion, assertion); + g_free (assertion); } g_slist_free (assertions); #endif /* G_ENABLE_CONSISTENCY_CHECKS */ @@ -8008,7 +8008,7 @@ gtk_widget_propagate_state (GtkWidget *widget, GtkRequisition * gtk_requisition_new (void) { - return g_slice_new0 (GtkRequisition); + return g_new0 (GtkRequisition, 1); } /** @@ -8022,7 +8022,9 @@ gtk_requisition_new (void) GtkRequisition * gtk_requisition_copy (const GtkRequisition *requisition) { - return g_slice_dup (GtkRequisition, requisition); + GtkRequisition *copy = g_new (GtkRequisition, 1); + memcpy (copy, requisition, sizeof (GtkRequisition)); + return copy; } /** @@ -8034,7 +8036,7 @@ gtk_requisition_copy (const GtkRequisition *requisition) void gtk_requisition_free (GtkRequisition *requisition) { - g_slice_free (GtkRequisition, requisition); + g_free (requisition); } G_DEFINE_BOXED_TYPE (GtkRequisition, gtk_requisition, @@ -9092,7 +9094,7 @@ gtk_widget_buildable_custom_tag_start (GtkBuildable *buildable, { StyleParserData *data; - data = g_slice_new0 (StyleParserData); + data = g_new0 (StyleParserData, 1); data->builder = builder; *parser = style_parser; @@ -9105,7 +9107,7 @@ gtk_widget_buildable_custom_tag_start (GtkBuildable *buildable, { LayoutParserData *data; - data = g_slice_new0 (LayoutParserData); + data = g_new0 (LayoutParserData, 1); data->builder = builder; data->object = (GObject *) g_object_ref (buildable); @@ -9119,7 +9121,7 @@ gtk_widget_buildable_custom_tag_start (GtkBuildable *buildable, { AccessibilityParserData *data; - data = g_slice_new0 (AccessibilityParserData); + data = g_new0 (AccessibilityParserData, 1); data->builder = builder; data->object = (GObject *) g_object_ref (buildable); @@ -9384,7 +9386,7 @@ gtk_widget_buildable_custom_finished (GtkBuildable *buildable, gtk_widget_add_css_class (GTK_WIDGET (buildable), (const char *)l->data); g_slist_free_full (style_data->classes, g_free); - g_slice_free (StyleParserData, style_data); + g_free (style_data); } else if (strcmp (tagname, "layout") == 0) { @@ -9399,7 +9401,7 @@ gtk_widget_buildable_custom_finished (GtkBuildable *buildable, /* Free the unapplied properties, if any */ g_slist_free_full (layout_data->properties, layout_property_info_free); g_object_unref (layout_data->object); - g_slice_free (LayoutParserData, layout_data); + g_free (layout_data); } else if (strcmp (tagname, "accessibility") == 0) { @@ -9415,7 +9417,7 @@ gtk_widget_buildable_custom_finished (GtkBuildable *buildable, g_slist_free_full (accessibility_data->states, accessibility_attribute_info_free); g_object_unref (accessibility_data->object); - g_slice_free (AccessibilityParserData, accessibility_data); + g_free (accessibility_data); } } @@ -11007,7 +11009,7 @@ template_child_class_new (const char *name, gboolean internal_child, gssize offset) { - AutomaticChildClass *child_class = g_slice_new0 (AutomaticChildClass); + AutomaticChildClass *child_class = g_new0 (AutomaticChildClass, 1); child_class->name = g_strdup (name); child_class->internal_child = internal_child; @@ -11267,7 +11269,7 @@ gtk_widget_class_set_template (GtkWidgetClass *widget_class, g_return_if_fail (widget_class->priv->template == NULL); g_return_if_fail (template_bytes != NULL); - widget_class->priv->template = g_slice_new0 (GtkWidgetTemplate); + widget_class->priv->template = g_new0 (GtkWidgetTemplate, 1); bytes_data = g_bytes_get_data (template_bytes, &bytes_size); if (_gtk_buildable_parser_is_precompiled (bytes_data, bytes_size)) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index dced97168b..75b9af1e2b 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -3202,7 +3202,7 @@ static void free_icon_info (GtkWindowIconInfo *info) { g_free (info->icon_name); - g_slice_free (GtkWindowIconInfo, info); + g_free (info); } @@ -3215,7 +3215,7 @@ ensure_icon_info (GtkWindow *window) if (info == NULL) { - info = g_slice_new0 (GtkWindowIconInfo); + info = g_new0 (GtkWindowIconInfo, 1); g_object_set_qdata_full (G_OBJECT (window), quark_gtk_window_icon_info, info, |