diff options
author | Johan Dahlin <johan@gnome.org> | 2010-05-20 11:33:49 -0300 |
---|---|---|
committer | Johan Dahlin <johan@gnome.org> | 2010-05-20 11:41:44 -0300 |
commit | 891ba6c46a19e647f063e12131823e61f40f9c98 (patch) | |
tree | fb0eba21c64e6548723b5772f4056aa3deeaf5e4 /girepository/girepository.c | |
parent | abfd1719b3fd08718fe8dc6892d4a7c76556d652 (diff) | |
download | gobject-introspection-891ba6c46a19e647f063e12131823e61f40f9c98.tar.gz |
[girepository] Use g_slice
Use g_slice to allocate instead of g_new(x, 1); It uses a memory
pool internally and should be faster, especially for GBaseInfo/GRealInfo,
structs which are tiny.
Diffstat (limited to 'girepository/girepository.c')
-rw-r--r-- | girepository/girepository.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/girepository/girepository.c b/girepository/girepository.c index 684db66e..218a954c 100644 --- a/girepository/girepository.c +++ b/girepository/girepository.c @@ -1043,7 +1043,7 @@ free_candidate (struct NamespaceVersionCandidadate *candidate) 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 * @@ -1111,7 +1111,7 @@ find_namespace_latest (const gchar *namespace, 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; @@ -1134,7 +1134,7 @@ find_namespace_latest (const gchar *namespace, 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); } |