[Spice-devel] [spice-server 1/2] Remove GSlice use
Christophe Fergeau
cfergeau at redhat.com
Thu Jan 14 08:08:18 PST 2016
It's being slowly deprecated in glib
https://bugzilla.gnome.org/show_bug.cgi?id=754687
---
NEWS | 2 --
server/cursor-channel.c | 4 ++--
server/red-replay-qxl.c | 4 ++--
3 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/NEWS b/NEWS
index 3b32b5c..e906e88 100644
--- a/NEWS
+++ b/NEWS
@@ -9,8 +9,6 @@ keep the code as functional as 0.12, but regressions or bugs could still happen.
* Start of a large code rework to attempt to make the codebase more
maintainable. With this first release, the huge red_worker.c file has been split
in multiple smaller files.
-* glib's GSlice is now used in some places, G_SLICE=(debug_blocks|always_malloc) may
- be needed in order to debug some memory issues.
* Added public spice_server_set_keepalive_timeout() to make it possible
to tweak keepalive on all SPICE connection. This can prevent unwanted
diff --git a/server/cursor-channel.c b/server/cursor-channel.c
index ec994e3..4c15582 100644
--- a/server/cursor-channel.c
+++ b/server/cursor-channel.c
@@ -95,7 +95,7 @@ static CursorItem *cursor_item_new(QXLInstance *qxl, RedCursorCmd *cmd, uint32_t
spice_return_val_if_fail(cmd != NULL, NULL);
- cursor_item = g_slice_new0(CursorItem);
+ cursor_item = g_new0(CursorItem, 1);
cursor_item->qxl = qxl;
cursor_item->refs = 1;
cursor_item->group_id = group_id;
@@ -131,7 +131,7 @@ static void cursor_item_unref(CursorItem *item)
red_put_cursor_cmd(cursor_cmd);
free(cursor_cmd);
- g_slice_free(CursorItem, item);
+ g_free(item);
}
diff --git a/server/red-replay-qxl.c b/server/red-replay-qxl.c
index 95a9fdd..8e0b28c 100644
--- a/server/red-replay-qxl.c
+++ b/server/red-replay-qxl.c
@@ -1134,7 +1134,7 @@ SPICE_GNUC_VISIBLE QXLCommandExt* spice_replay_next_cmd(SpiceReplay *replay,
replay_handle_dev_input(worker, replay, type);
}
}
- cmd = g_slice_new(QXLCommandExt);
+ cmd = g_new(QXLCommandExt, 1);
cmd->cmd.type = type;
cmd->group_id = 0;
spice_debug("command %"PRIu64", %d\r", timestamp, cmd->cmd.type);
@@ -1195,7 +1195,7 @@ SPICE_GNUC_VISIBLE void spice_replay_free_cmd(SpiceReplay *replay, QXLCommandExt
break;
}
- g_slice_free(QXLCommandExt, cmd);
+ g_free(cmd);
}
/* caller is incharge of closing the replay when done and releasing the SpiceReplay
--
2.5.0
More information about the Spice-devel
mailing list