mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 08:18:03 +02:00
dispatcher: use slice allocator for Request and ScriptInfo
This commit is contained in:
parent
e97a334e37
commit
8143d895ca
1 changed files with 6 additions and 4 deletions
|
|
@ -140,7 +140,7 @@ script_info_free (gpointer ptr)
|
||||||
|
|
||||||
g_free (info->script);
|
g_free (info->script);
|
||||||
g_free (info->error);
|
g_free (info->error);
|
||||||
g_free (info);
|
g_slice_free (ScriptInfo, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -155,7 +155,7 @@ request_free (Request *request)
|
||||||
if (request->scripts)
|
if (request->scripts)
|
||||||
g_ptr_array_free (request->scripts, TRUE);
|
g_ptr_array_free (request->scripts, TRUE);
|
||||||
|
|
||||||
g_free (request);
|
g_slice_free (Request, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
@ -637,7 +637,7 @@ handle_action (NMDBusDispatcher *dbus_dispatcher,
|
||||||
|
|
||||||
nm_clear_g_source (&quit_id);
|
nm_clear_g_source (&quit_id);
|
||||||
|
|
||||||
request = g_malloc0 (sizeof (*request));
|
request = g_slice_new0 (Request);
|
||||||
request->handler = h;
|
request->handler = h;
|
||||||
request->debug = request_debug || debug;
|
request->debug = request_debug || debug;
|
||||||
request->context = context;
|
request->context = context;
|
||||||
|
|
@ -668,7 +668,9 @@ handle_action (NMDBusDispatcher *dbus_dispatcher,
|
||||||
|
|
||||||
request->scripts = g_ptr_array_new_full (5, script_info_free);
|
request->scripts = g_ptr_array_new_full (5, script_info_free);
|
||||||
for (iter = sorted_scripts; iter; iter = g_slist_next (iter)) {
|
for (iter = sorted_scripts; iter; iter = g_slist_next (iter)) {
|
||||||
ScriptInfo *s = g_malloc0 (sizeof (*s));
|
ScriptInfo *s;
|
||||||
|
|
||||||
|
s = g_slice_new0 (ScriptInfo);
|
||||||
s->request = request;
|
s->request = request;
|
||||||
s->script = iter->data;
|
s->script = iter->data;
|
||||||
s->wait = script_must_wait (s->script);
|
s->wait = script_must_wait (s->script);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue