g_return_val_if_fail (container != NULL || repository != NULL, NULL);
- info = g_new (GIRealInfo, 1);
+ info = g_slice_new (GIRealInfo);
g_info_init (info, type, repository, container, typelib, offset);
info->ref_count = 1;
{
GIUnresolvedInfo *unresolved;
- unresolved = g_new0 (GIUnresolvedInfo, 1);
+ unresolved = g_slice_new0 (GIUnresolvedInfo);
unresolved->type = GI_INFO_TYPE_UNRESOLVED;
unresolved->ref_count = 1;
unresolved->namespace = namespace;
return (GIBaseInfo *)unresolved;
- }
+ }
return (GIBaseInfo *)result;
}
if (rinfo->repository)
g_object_unref (rinfo->repository);
- g_free (rinfo);
+ g_slice_free (GIRealInfo, rinfo);
}
}
g_mapped_file_unref (candidate->mfile);
g_free (candidate->path);
g_free (candidate->version);
- g_free (candidate);
+ g_slice_free (struct NamespaceVersionCandidadate, candidate);
}
static GMappedFile *
g_clear_error (&error);
continue;
}
- candidate = g_new0 (struct NamespaceVersionCandidadate, 1);
+ candidate = g_slice_new0 (struct NamespaceVersionCandidadate);
candidate->mfile = mfile;
candidate->path_index = index;
candidate->path = path;
result = elected->mfile;
*path_ret = elected->path;
*version_ret = elected->version;
- g_free (elected); /* just free the container */
+ g_slice_free (struct NamespaceVersionCandidadate, elected); /* just free the container */
g_slist_foreach (candidates, (GFunc) free_candidate, NULL);
g_slist_free (candidates);
}
{
GIrModule *module;
- module = g_new0 (GIrModule, 1);
+ module = g_slice_new0 (GIrModule);
module->name = g_strdup (name);
module->version = g_strdup (version);
g_hash_table_destroy (module->aliases);
g_hash_table_destroy (module->disguised_structures);
- g_free (module);
+ g_slice_free (GIrModule, module);
}
/**
{
GTypelib *meta;
- meta = g_new0 (GTypelib, 1);
+ meta = g_slice_new0 (GTypelib);
meta->data = memory;
meta->len = len;
meta->owns_memory = TRUE;
{
GTypelib *meta;
- meta = g_new0 (GTypelib, 1);
+ meta = g_slice_new0 (GTypelib);
meta->data = (guchar *) memory;
meta->len = len;
meta->owns_memory = FALSE;
{
GTypelib *meta;
- meta = g_new0 (GTypelib, 1);
+ meta = g_slice_new0 (GTypelib);
meta->mfile = mfile;
meta->owns_memory = FALSE;
meta->data = (guchar *) g_mapped_file_get_contents (mfile);
g_list_foreach (typelib->modules, (GFunc) g_module_close, NULL);
g_list_free (typelib->modules);
}
- g_free (typelib);
+ g_slice_free (GTypelib, typelib);
}
const gchar *