Commit 5502b1cb authored by Michael Catanzaro's avatar Michael Catanzaro Committed by Michael Catanzaro

Stop using the slice allocator

In Epiphany we currently use the slice allocator for random structs,
then fill the structs with memory inevitably managed by system malloc.
There's no rhyme or reason to it. The slice allocator has fallen out of
favor, so stop using it. See:

glib#1079
parent 0222d881
Pipeline #44328 passed with stage
in 2 minutes and 24 seconds
......@@ -183,7 +183,7 @@ ephy_embed_statusbar_push (EphyEmbed *embed, guint context_id, const char *text)
g_assert (context_id != 0);
g_assert (text != NULL);
msg = g_slice_new (EphyEmbedStatusbarMsg);
msg = g_new (EphyEmbedStatusbarMsg, 1);
msg->text = g_strdup (text);
msg->context_id = context_id;
msg->message_id = embed->seq_message_id++;
......@@ -212,7 +212,7 @@ ephy_embed_statusbar_pop (EphyEmbed *embed, guint context_id)
if (msg->context_id == context_id) {
embed->messages = g_slist_remove_link (embed->messages, list);
g_free (msg->text);
g_slice_free (EphyEmbedStatusbarMsg, msg);
g_free (msg);
g_slist_free_1 (list);
break;
}
......@@ -414,7 +414,7 @@ ephy_embed_finalize (GObject *object)
msg = list->data;
g_free (msg->text);
g_slice_free (EphyEmbedStatusbarMsg, msg);
g_free (msg);
}
g_slist_free (embed->messages);
......
......@@ -91,7 +91,7 @@ adblock_filter_retrieve_data_new (EphyFiltersManager *manager,
const char *source_uri)
{
AdblockFilterRetrieveData* data;
data = g_slice_new (AdblockFilterRetrieveData);
data = g_new (AdblockFilterRetrieveData, 1);
data->manager = g_object_ref (manager);
data->download = g_object_ref (download);
data->source_uri = g_strdup (source_uri);
......@@ -104,7 +104,7 @@ adblock_filter_retrieve_data_free (AdblockFilterRetrieveData *data)
g_object_unref (data->manager);
g_object_unref (data->download);
g_free (data->source_uri);
g_slice_free (AdblockFilterRetrieveData, data);
g_free (data);
}
static void
......
......@@ -51,7 +51,7 @@ ephy_view_source_request_new (EphyViewSourceHandler *handler,
{
EphyViewSourceRequest *view_source_request;
view_source_request = g_slice_new (EphyViewSourceRequest);
view_source_request = g_new (EphyViewSourceRequest, 1);
view_source_request->source_handler = g_object_ref (handler);
view_source_request->scheme_request = g_object_ref (request);
view_source_request->web_view = NULL; /* created only if required */
......@@ -74,7 +74,7 @@ ephy_view_source_request_free (EphyViewSourceRequest *request)
g_cancellable_cancel (request->cancellable);
g_object_unref (request->cancellable);
g_slice_free (EphyViewSourceRequest, request);
g_free (request);
}
static void
......
......@@ -176,7 +176,7 @@ popups_manager_free_info (PopupInfo *popup)
g_free (popup->url);
g_free (popup->name);
g_free (popup->features);
g_slice_free (PopupInfo, popup);
g_free (popup);
}
static void
......@@ -241,7 +241,7 @@ popups_manager_add (EphyWebView *view,
LOG ("popups_manager_add: view %p, url %s, features %s",
view, url, features);
popup = g_slice_new (PopupInfo);
popup = g_new (PopupInfo, 1);
popup->url = g_strdup (url);
popup->name = g_strdup (name);
......@@ -1474,7 +1474,7 @@ permission_request_data_new (EphyWebView *web_view,
const char *origin)
{
PermissionRequestData *data;
data = g_slice_new (PermissionRequestData);
data = g_new (PermissionRequestData, 1);
data->web_view = web_view;
/* Ref the decision to keep it alive while we decide */
data->request = g_object_ref (request);
......@@ -1487,7 +1487,7 @@ permission_request_data_free (PermissionRequestData *data)
{
g_object_unref (data->request);
g_free (data->origin);
g_slice_free (PermissionRequestData, data);
g_free (data);
}
static void
......@@ -3334,7 +3334,7 @@ get_best_web_app_icon_async_data_free (GetBestWebAppIconAsyncData *data)
g_free (data->icon_uri);
g_free (data->icon_color);
g_slice_free (GetBestWebAppIconAsyncData, data);
g_free (data);
}
static void
......@@ -3350,7 +3350,7 @@ get_best_web_app_icon_cb (WebKitWebView *view,
JSCValue *js_value, *js_uri, *js_color;
GetBestWebAppIconAsyncData *data;
data = g_slice_new0 (GetBestWebAppIconAsyncData);
data = g_new0 (GetBestWebAppIconAsyncData, 1);
js_value = webkit_javascript_result_get_js_value (js_result);
g_assert (jsc_value_is_object (js_value));
......
......@@ -330,7 +330,7 @@ ephy_web_overview_model_item_new (const char *url,
{
EphyWebOverviewModelItem *item;
item = g_slice_new0 (EphyWebOverviewModelItem);
item = g_new0 (EphyWebOverviewModelItem, 1);
item->url = g_strdup (url);
item->title = g_strdup (title);
......@@ -346,7 +346,7 @@ ephy_web_overview_model_item_free (EphyWebOverviewModelItem *item)
g_free (item->url);
g_free (item->title);
g_slice_free (EphyWebOverviewModelItem, item);
g_free (item);
}
static void
......
......@@ -102,13 +102,12 @@ static void vma_free (VMA_t *vma)
g_free (vma->private_clean);
g_free (vma->private_dirty);
g_slice_free (VMA_t, vma);
g_free (vma);
}
static void perm_entry_free (PermEntry *entry)
{
if (entry)
g_slice_free (PermEntry, entry);
g_free (entry);
}
static void add_to_perm_entry (GHashTable *hash, VMA_t *entry)
......@@ -121,7 +120,7 @@ static void add_to_perm_entry (GHashTable *hash, VMA_t *entry)
value = g_hash_table_lookup (hash, perms);
if (!value) {
value = g_slice_new0 (PermEntry);
value = g_new0 (PermEntry, 1);
insert = TRUE;
}
......@@ -228,7 +227,7 @@ static void ephy_smaps_pid_to_html (EphySMaps *smaps, GString *str, pid_t pid, E
if (vma)
vma_entries = g_slist_append (vma_entries, vma);
vma = g_slice_new0 (VMA_t);
vma = g_new0 (VMA_t, 1);
vma->start = g_match_info_fetch (match_info, 1);
vma->end = g_match_info_fetch (match_info, 2);
......
......@@ -288,7 +288,7 @@ snapshot_async_data_new (EphySnapshotService *service,
{
SnapshotAsyncData *data;
data = g_slice_new0 (SnapshotAsyncData);
data = g_new0 (SnapshotAsyncData, 1);
data->service = g_object_ref (service);
data->snapshot = snapshot ? g_object_ref (snapshot) : NULL;
data->web_view = web_view;
......@@ -320,8 +320,7 @@ snapshot_async_data_free (SnapshotAsyncData *data)
g_object_remove_weak_pointer (G_OBJECT (data->web_view), (gpointer *)&data->web_view);
g_free (data->url);
g_slice_free (SnapshotAsyncData, data);
g_free (data);
}
typedef struct {
......
......@@ -48,7 +48,7 @@ query_item_free (QueryItem *item)
{
g_free (item->decoded_name);
g_free (item->pair);
g_slice_free (QueryItem, item);
g_free (item);
}
#define XDIGIT(c) ((c) <= '9' ? (c) - '0' : ((c) & 0x4F) - 'A' + 10)
......@@ -103,7 +103,7 @@ query_split (const char *query)
decoded_name = NULL;
}
item = g_slice_new0 (QueryItem);
item = g_new0 (QueryItem, 1);
item->decoded_name = decoded_name;
item->pair = pair;
items = g_list_prepend (items, item);
......
......@@ -471,7 +471,7 @@ ephy_web_application_free (EphyWebApplication *app)
g_free (app->icon_url);
g_free (app->url);
g_free (app->desktop_file);
g_slice_free (EphyWebApplication, app);
g_free (app);
}
......@@ -494,7 +494,7 @@ ephy_web_application_for_profile_directory (const char *profile_dir)
if (!id)
return NULL;
app = g_slice_new0 (EphyWebApplication);
app = g_new0 (EphyWebApplication, 1);
app->id = g_strdup (id);
app->desktop_file = get_app_desktop_filename (id);
......
......@@ -325,7 +325,7 @@ ephy_history_service_message_new (EphyHistoryService *service,
EphyHistoryJobCallback callback,
gpointer user_data)
{
EphyHistoryServiceMessage *message = g_slice_alloc0 (sizeof (EphyHistoryServiceMessage));
EphyHistoryServiceMessage *message = g_new0 (EphyHistoryServiceMessage, 1);
message->service = service;
message->type = type;
......@@ -347,7 +347,7 @@ ephy_history_service_message_free (EphyHistoryServiceMessage *message)
if (message->cancellable)
g_object_unref (message->cancellable);
g_slice_free1 (sizeof (EphyHistoryServiceMessage), message);
g_free (message);
}
static void
......@@ -523,7 +523,7 @@ signal_emission_context_free (SignalEmissionContext *ctx)
g_object_unref (ctx->service);
if (ctx->destroy_func && ctx->user_data)
ctx->destroy_func (ctx->user_data);
g_slice_free (SignalEmissionContext, ctx);
g_free (ctx);
}
static SignalEmissionContext *
......@@ -531,7 +531,7 @@ signal_emission_context_new (EphyHistoryService *service,
gpointer user_data,
GDestroyNotify destroy_func)
{
SignalEmissionContext *ctx = g_slice_new0 (SignalEmissionContext);
SignalEmissionContext *ctx = g_new0 (SignalEmissionContext, 1);
ctx->service = g_object_ref (service);
ctx->user_data = user_data;
......
......@@ -25,7 +25,7 @@
EphyHistoryPageVisit *
ephy_history_page_visit_new_with_url (EphyHistoryURL *url, gint64 visit_time, EphyHistoryPageVisitType visit_type)
{
EphyHistoryPageVisit *visit = g_slice_alloc0 (sizeof (EphyHistoryPageVisit));
EphyHistoryPageVisit *visit = g_new0 (EphyHistoryPageVisit, 1);
visit->id = -1;
visit->url = url;
visit->visit_time = visit_time;
......@@ -47,7 +47,7 @@ ephy_history_page_visit_free (EphyHistoryPageVisit *visit)
return;
ephy_history_url_free (visit->url);
g_slice_free1 (sizeof (EphyHistoryPageVisit), visit);
g_free (visit);
}
EphyHistoryPageVisit *
......@@ -80,7 +80,7 @@ ephy_history_page_visit_list_free (GList *list)
EphyHistoryHost *
ephy_history_host_new (const char *url, const char *title, int visit_count, double zoom_level)
{
EphyHistoryHost *host = g_slice_alloc0 (sizeof (EphyHistoryHost));
EphyHistoryHost *host = g_new0 (EphyHistoryHost, 1);
host->id = -1;
host->url = g_strdup (url);
......@@ -116,14 +116,13 @@ ephy_history_host_free (EphyHistoryHost *host)
g_free (host->url);
g_free (host->title);
g_slice_free1 (sizeof (EphyHistoryHost), host);
g_free (host);
}
EphyHistoryURL *
ephy_history_url_new (const char *url, const char *title, int visit_count, int typed_count, gint64 last_visit_time)
{
EphyHistoryURL *history_url = g_slice_alloc0 (sizeof (EphyHistoryURL));
EphyHistoryURL *history_url = g_new0 (EphyHistoryURL, 1);
history_url->id = -1;
history_url->url = g_strdup (url);
history_url->title = g_strdup (title);
......@@ -169,7 +168,7 @@ ephy_history_url_free (EphyHistoryURL *url)
g_free (url->title);
g_free (url->sync_id);
ephy_history_host_free (url->host);
g_slice_free1 (sizeof (EphyHistoryURL), url);
g_free (url);
}
GList *
......@@ -200,14 +199,14 @@ ephy_history_url_list_free (GList *list)
EphyHistoryQuery *
ephy_history_query_new (void)
{
return (EphyHistoryQuery *)g_slice_alloc0 (sizeof (EphyHistoryQuery));
return g_new0 (EphyHistoryQuery, 1);
}
void
ephy_history_query_free (EphyHistoryQuery *query)
{
g_list_free_full (query->substring_list, g_free);
g_slice_free1 (sizeof (EphyHistoryQuery), query);
g_free (query);
}
EphyHistoryQuery *
......
......@@ -55,7 +55,7 @@ ephy_gsb_bit_reader_new (const guint8 *data,
g_assert (data);
g_assert (data_len > 0);
reader = g_slice_new (EphyGSBBitReader);
reader = g_new (EphyGSBBitReader, 1);
reader->curr = reader->data = g_malloc (data_len);
memcpy (reader->data, data, data_len);
reader->data_len = data_len;
......@@ -71,7 +71,7 @@ ephy_gsb_bit_reader_free (EphyGSBBitReader *reader)
g_assert (reader);
g_free (reader->data);
g_slice_free (EphyGSBBitReader, reader);
g_free (reader);
}
/*
......@@ -116,7 +116,7 @@ ephy_gsb_rice_decoder_new (const guint8 *data,
g_assert (data);
g_assert (data_len > 0);
decoder = g_slice_new (EphyGSBRiceDecoder);
decoder = g_new (EphyGSBRiceDecoder, 1);
decoder->reader = ephy_gsb_bit_reader_new (data, data_len);
decoder->parameter = parameter;
......@@ -129,7 +129,7 @@ ephy_gsb_rice_decoder_free (EphyGSBRiceDecoder *decoder)
g_assert (decoder);
ephy_gsb_bit_reader_free (decoder->reader);
g_slice_free (EphyGSBRiceDecoder, decoder);
g_free (decoder);
}
static guint32
......@@ -161,7 +161,7 @@ ephy_gsb_threat_list_new (const char *threat_type,
g_assert (platform_type);
g_assert (threat_entry_type);
list = g_slice_new (EphyGSBThreatList);
list = g_new (EphyGSBThreatList, 1);
list->threat_type = g_strdup (threat_type);
list->platform_type = g_strdup (platform_type);
list->threat_entry_type = g_strdup (threat_entry_type);
......@@ -178,7 +178,7 @@ ephy_gsb_threat_list_free (EphyGSBThreatList *list)
g_free (list->platform_type);
g_free (list->threat_entry_type);
g_free (list->client_state);
g_slice_free (EphyGSBThreatList, list);
g_free (list);
}
gboolean
......@@ -207,7 +207,7 @@ ephy_gsb_hash_prefix_lookup_new (const guint8 *prefix,
g_assert (prefix);
lookup = g_slice_new (EphyGSBHashPrefixLookup);
lookup = g_new (EphyGSBHashPrefixLookup, 1);
lookup->prefix = g_bytes_new (prefix, length);
lookup->negative_expired = negative_expired;
......@@ -220,7 +220,7 @@ ephy_gsb_hash_prefix_lookup_free (EphyGSBHashPrefixLookup *lookup)
g_assert (lookup);
g_bytes_unref (lookup->prefix);
g_slice_free (EphyGSBHashPrefixLookup, lookup);
g_free (lookup);
}
EphyGSBHashFullLookup *
......@@ -237,7 +237,7 @@ ephy_gsb_hash_full_lookup_new (const guint8 *hash,
g_assert (platform_type);
g_assert (threat_entry_type);
lookup = g_slice_new (EphyGSBHashFullLookup);
lookup = g_new (EphyGSBHashFullLookup, 1);
lookup->hash = g_bytes_new (hash, GSB_HASH_SIZE);
lookup->threat_type = g_strdup (threat_type);
lookup->platform_type = g_strdup (platform_type);
......@@ -256,7 +256,7 @@ ephy_gsb_hash_full_lookup_free (EphyGSBHashFullLookup *lookup)
g_free (lookup->threat_type);
g_free (lookup->platform_type);
g_free (lookup->threat_entry_type);
g_slice_free (EphyGSBHashFullLookup, lookup);
g_free (lookup);
}
static JsonObject *
......
......@@ -64,7 +64,7 @@ merge_history_async_data_new (EphyHistoryManager *manager,
{
MergeHistoryAsyncData *data;
data = g_slice_new (MergeHistoryAsyncData);
data = g_new (MergeHistoryAsyncData, 1);
data->manager = g_object_ref (manager);
data->is_initial = is_initial;
data->remotes_deleted = remotes_deleted;
......@@ -81,7 +81,7 @@ merge_history_async_data_free (MergeHistoryAsyncData *data)
g_assert (data);
g_object_unref (data->manager);
g_slice_free (MergeHistoryAsyncData, data);
g_free (data);
}
static void
......
......@@ -64,7 +64,7 @@ ephy_history_record_visit_new (gint64 timestamp,
{
EphyHistoryRecordVisit *visit;
visit = g_slice_new (EphyHistoryRecordVisit);
visit = g_new (EphyHistoryRecordVisit, 1);
visit->timestamp = timestamp;
visit->type = type;
......@@ -76,7 +76,7 @@ ephy_history_record_visit_free (EphyHistoryRecordVisit *visit)
{
g_assert (visit);
g_slice_free (EphyHistoryRecordVisit, visit);
g_free (visit);
}
static int
......
......@@ -91,7 +91,7 @@ query_async_data_new (EphyPasswordManagerQueryCallback callback,
{
QueryAsyncData *data;
data = g_slice_new (QueryAsyncData);
data = g_new (QueryAsyncData, 1);
data->callback = callback;
data->user_data = user_data;
......@@ -103,7 +103,7 @@ query_async_data_free (QueryAsyncData *data)
{
g_assert (data);
g_slice_free (QueryAsyncData, data);
g_free (data);
}
static UpdatePasswordAsyncData *
......@@ -112,7 +112,7 @@ update_password_async_data_new (EphyPasswordManager *manager,
{
UpdatePasswordAsyncData *data;
data = g_slice_new (UpdatePasswordAsyncData);
data = g_new (UpdatePasswordAsyncData, 1);
data->manager = g_object_ref (manager);
data->password = g_strdup (password);
......@@ -126,7 +126,7 @@ update_password_async_data_free (UpdatePasswordAsyncData *data)
g_object_unref (data->manager);
g_free (data->password);
g_slice_free (UpdatePasswordAsyncData, data);
g_free (data);
}
static MergePasswordsAsyncData *
......@@ -139,7 +139,7 @@ merge_passwords_async_data_new (EphyPasswordManager *manager,
{
MergePasswordsAsyncData *data;
data = g_slice_new (MergePasswordsAsyncData);
data = g_new (MergePasswordsAsyncData, 1);
data->manager = g_object_ref (manager);
data->is_initial = is_initial;
data->remotes_deleted = remotes_deleted;
......@@ -156,7 +156,7 @@ merge_passwords_async_data_free (MergePasswordsAsyncData *data)
g_assert (data);
g_object_unref (data->manager);
g_slice_free (MergePasswordsAsyncData, data);
g_free (data);
}
static ManageRecordAsyncData *
......@@ -165,7 +165,7 @@ manage_record_async_data_new (EphyPasswordManager *manager,
{
ManageRecordAsyncData *data;
data = g_slice_new (ManageRecordAsyncData);
data = g_new (ManageRecordAsyncData, 1);
data->manager = g_object_ref (manager);
data->record = g_object_ref (record);
......@@ -179,7 +179,7 @@ manage_record_async_data_free (ManageRecordAsyncData *data)
g_object_unref (data->manager);
g_object_unref (data->record);
g_slice_free (ManageRecordAsyncData, data);
g_free (data);
}
static GHashTable *
......
......@@ -51,7 +51,7 @@ ephy_sync_crypto_hawk_options_new (const char *app,
{
SyncCryptoHawkOptions *options;
options = g_slice_new (SyncCryptoHawkOptions);
options = g_new (SyncCryptoHawkOptions, 1);
options->app = g_strdup (app);
options->dlg = g_strdup (dlg);
options->ext = g_strdup (ext);
......@@ -80,7 +80,7 @@ ephy_sync_crypto_hawk_options_free (SyncCryptoHawkOptions *options)
g_free (options->payload);
g_free (options->timestamp);
g_slice_free (SyncCryptoHawkOptions, options);
g_free (options);
}
static SyncCryptoHawkArtifacts *
......@@ -97,7 +97,7 @@ ephy_sync_crypto_hawk_artifacts_new (const char *app,
{
SyncCryptoHawkArtifacts *artifacts;
artifacts = g_slice_new (SyncCryptoHawkArtifacts);
artifacts = g_new (SyncCryptoHawkArtifacts, 1);
artifacts->app = g_strdup (app);
artifacts->dlg = g_strdup (dlg);
artifacts->ext = g_strdup (ext);
......@@ -128,7 +128,7 @@ ephy_sync_crypto_hawk_artifacts_free (SyncCryptoHawkArtifacts *artifacts)
g_free (artifacts->resource);
g_free (artifacts->ts);
g_slice_free (SyncCryptoHawkArtifacts, artifacts);
g_free (artifacts);
}
static char *
......@@ -381,7 +381,7 @@ ephy_sync_crypto_hawk_header_new (const char *url,
header = hawk_append_to_header (header, "dlg", artifacts->dlg);
}
hawk_header = g_slice_new (SyncCryptoHawkHeader);
hawk_header = g_new (SyncCryptoHawkHeader, 1);
hawk_header->header = g_strdup (header);
hawk_header->artifacts = artifacts;
......@@ -403,7 +403,7 @@ ephy_sync_crypto_hawk_header_free (SyncCryptoHawkHeader *header)
g_free (header->header);
ephy_sync_crypto_hawk_artifacts_free (header->artifacts);
g_slice_free (SyncCryptoHawkHeader, header);
g_free (header);
}
SyncCryptoRSAKeyPair *
......@@ -427,7 +427,7 @@ ephy_sync_crypto_rsa_key_pair_new (void)
/* Given correct parameters, this never fails. */
g_assert (success);
key_pair = g_slice_new (SyncCryptoRSAKeyPair);
key_pair = g_new (SyncCryptoRSAKeyPair, 1);
key_pair->public = public;
key_pair->private = private;
......@@ -442,7 +442,7 @@ ephy_sync_crypto_rsa_key_pair_free (SyncCryptoRSAKeyPair *key_pair)
rsa_public_key_clear (&key_pair->public);
rsa_private_key_clear (&key_pair->private);
g_slice_free (SyncCryptoRSAKeyPair, key_pair);
g_free (key_pair);
}
SyncCryptoKeyBundle *
......@@ -463,7 +463,7 @@ ephy_sync_crypto_key_bundle_new (const char *aes_key_b64,
hmac_key = g_base64_decode (hmac_key_b64, &hmac_key_len);
g_assert (hmac_key_len == 32);
bundle = g_slice_new (SyncCryptoKeyBundle);
bundle = g_new (SyncCryptoKeyBundle, 1);
bundle->aes_key_hex = ephy_sync_utils_encode_hex (aes_key, aes_key_len);
bundle->hmac_key_hex = ephy_sync_utils_encode_hex (hmac_key, hmac_key_len);
......@@ -481,7 +481,7 @@ ephy_sync_crypto_key_bundle_free (SyncCryptoKeyBundle *bundle)
g_free (bundle->aes_key_hex);
g_free (bundle->hmac_key_hex);
g_slice_free (SyncCryptoKeyBundle, bundle);
g_free (bundle);
}
static char *
......@@ -790,7 +790,7 @@ ephy_sync_crypto_derive_master_bundle (const guint8 *key)
prk, len,
tmp, len + strlen (info) + 1);
bundle = g_slice_new (SyncCryptoKeyBundle);
bundle = g_new (SyncCryptoKeyBundle, 1);
bundle->aes_key_hex = g_strdup (aes_key_hex);
bundle->hmac_key_hex = g_strdup (hmac_key_hex);
......
......@@ -154,7 +154,7 @@ storage_request_async_data_new (const char *endpoint,
{
StorageRequestAsyncData *data;
data = g_slice_new (StorageRequestAsyncData);
data = g_new (StorageRequestAsyncData, 1);
data->endpoint = g_strdup (endpoint);
data->method = g_strdup (method);
data->request_body = g_strdup (request_body);
......@@ -174,7 +174,7 @@ storage_request_async_data_free (StorageRequestAsyncData *data)
g_free (data->endpoint);
g_free (data->method);
g_free (data->request_body);
g_slice_free (StorageRequestAsyncData, data);
g_free (data);
}
static SignInAsyncData *
......@@ -190,7 +190,7 @@ sign_in_async_data_new (EphySyncService *service,
{
SignInAsyncData *data;
data = g_slice_new (SignInAsyncData);
data = g_new (SignInAsyncData, 1);
data->service = g_object_ref (service);
data->email = g_strdup (email);
data->uid = g_strdup (uid);
......@@ -221,7 +221,7 @@ sign_in_async_data_free (SignInAsyncData *data)
g_free (data->req_hmac_key);
g_free (data->resp_hmac_key);
g_free (data->resp_xor_key);
g_slice_free (SignInAsyncData, data);
g_free (data);
}
static SyncCollectionAsyncData *
......@@ -232,7 +232,7 @@ sync_collection_async_data_new (EphySyncService *service,
{
SyncCollectionAsyncData *data;
data = g_slice_new (SyncCollectionAsyncData);
data = g_new (SyncCollectionAsyncData, 1);
data->service = g_object_ref (service);
data->manager = g_object_ref (manager);
data->is_initial = is_initial;
......@@ -252,7 +252,7 @@ sync_collection_async_data_free (SyncCollectionAsyncData *data)
g_object_unref (data->manager);
g_list_free_full (data->remotes_deleted, g_object_unref);
g_list_free_full (data->remotes_updated, g_object_unref);
g_slice_free (SyncCollectionAsyncData, data);
g_free (data);
}
static SyncAsyncData *
......@@ -262,7 +262,7 @@ sync_async_data_new (EphySyncService *service,
{
SyncAsyncData *data;
data = g_slice_new (SyncAsyncData);
data = g_new (SyncAsyncData, 1);
data->service = g_object_ref (service);
data->manager = g_object_ref (manager);
data->synchronizable = g_object_ref (synchronizable);
......@@ -278,7 +278,7 @@ sync_async_data_free (SyncAsyncData *data)
g_object_unref (data->service);
g_object_unref (data->manager);
g_object_unref (data->synchronizable);
g_slice_free (SyncAsyncData, data);
g_free (data);
}
static inline BatchUploadAsyncData *
......@@ -293,7 +293,7 @@ batch_upload_async_data_new (EphySyncService *service,
{
BatchUploadAsyncData *data;
data = g_slice_new (BatchUploadAsyncData);
data = g_new (BatchUploadAsyncData, 1);
data->service = g_object_ref (service);
data->manager = g_object_ref (manager);
data->synchronizables = g_ptr_array_ref (synchronizables);
......@@ -326,7 +326,7 @@ batch_upload_async_data_free (BatchUploadAsyncData *data)
g_object_unref (data->manager);
g_ptr_array_unref (data->synchronizables);
g_free (data->batch_id);
g_slice_free (BatchUploadAsyncData, data);
g_free (data);
}
static void
......
......@@ -858,7 +858,7 @@ free_prefetch_helper (PrefetchHelper *helper)
{
soup_uri_free (helper->uri);
g_object_unref (helper->entry);
g_slice_free (PrefetchHelper, helper);
g_free (helper);
}
static gboolean
......@@ -889,7 +889,7 @@ schedule_dns_prefetch (EphyLocationEntry *entry, guint interval, const gchar *ur
if (entry->dns_prefetch_handler)
g_source_remove (entry->dns_prefetch_handler);
helper = g_slice_new0 (PrefetchHelper);
helper = g_new0 (PrefetchHelper, 1);
helper->entry = g_object_ref (entry);
helper->uri = uri;
......
......@@ -146,7 +146,7 @@ notebook_tracker_set_notebook (NotebookTracker *tracker,
static NotebookTracker *
notebook_tracker_new (EphyNotebook *notebook)
{
NotebookTracker *tracker = g_slice_new0 (NotebookTracker);
NotebookTracker *tracker = g_new0 (NotebookTracker, 1);
tracker->ref_count = 1;
notebook_tracker_set_notebook (tracker, notebook);
......@@ -169,7 +169,7 @@ notebook_tracker_unref (NotebookTracker *tracker)
return;
notebook_tracker_set_notebook (tracker, NULL);