base: bitwriter: drop use of GSlice

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
This commit is contained in:
Tim-Philipp Müller 2023-01-08 02:02:53 +00:00 committed by GStreamer Marge Bot
parent 3dd12cb640
commit 45aac1e938

View file

@ -51,7 +51,7 @@
GstBitWriter * GstBitWriter *
gst_bit_writer_new (void) gst_bit_writer_new (void)
{ {
GstBitWriter *ret = g_slice_new0 (GstBitWriter); GstBitWriter *ret = g_new0 (GstBitWriter, 1);
ret->owned = TRUE; ret->owned = TRUE;
ret->auto_grow = TRUE; ret->auto_grow = TRUE;
@ -72,7 +72,7 @@ gst_bit_writer_new (void)
GstBitWriter * GstBitWriter *
gst_bit_writer_new_with_size (guint size, gboolean fixed) gst_bit_writer_new_with_size (guint size, gboolean fixed)
{ {
GstBitWriter *ret = g_slice_new0 (GstBitWriter); GstBitWriter *ret = g_new0 (GstBitWriter, 1);
gst_bit_writer_init_with_size (ret, size, fixed); gst_bit_writer_init_with_size (ret, size, fixed);
return ret; return ret;
@ -95,7 +95,7 @@ gst_bit_writer_new_with_size (guint size, gboolean fixed)
GstBitWriter * GstBitWriter *
gst_bit_writer_new_with_data (guint8 * data, guint size, gboolean initialized) gst_bit_writer_new_with_data (guint8 * data, guint size, gboolean initialized)
{ {
GstBitWriter *ret = g_slice_new0 (GstBitWriter); GstBitWriter *ret = g_new0 (GstBitWriter, 1);
gst_bit_writer_init_with_data (ret, data, size, initialized); gst_bit_writer_init_with_data (ret, data, size, initialized);
@ -260,7 +260,7 @@ gst_bit_writer_free (GstBitWriter * bitwriter)
g_return_if_fail (bitwriter != NULL); g_return_if_fail (bitwriter != NULL);
gst_bit_writer_reset (bitwriter); gst_bit_writer_reset (bitwriter);
g_slice_free (GstBitWriter, bitwriter); g_free (bitwriter);
} }
/** /**
@ -283,7 +283,7 @@ gst_bit_writer_free_and_get_data (GstBitWriter * bitwriter)
g_return_val_if_fail (bitwriter != NULL, NULL); g_return_val_if_fail (bitwriter != NULL, NULL);
data = gst_bit_writer_reset_and_get_data (bitwriter); data = gst_bit_writer_reset_and_get_data (bitwriter);
g_slice_free (GstBitWriter, bitwriter); g_free (bitwriter);
return data; return data;
} }
@ -308,7 +308,7 @@ gst_bit_writer_free_and_get_buffer (GstBitWriter * bitwriter)
g_return_val_if_fail (bitwriter != NULL, NULL); g_return_val_if_fail (bitwriter != NULL, NULL);
buffer = gst_bit_writer_reset_and_get_buffer (bitwriter); buffer = gst_bit_writer_reset_and_get_buffer (bitwriter);
g_slice_free (GstBitWriter, bitwriter); g_free (bitwriter);
return buffer; return buffer;
} }