Changeset 7dcef03 for global.c


Ignore:
Timestamp:
Dec 25, 2013, 11:33:37 AM (10 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10
Children:
8f95fc4, c53f5e8, 1bd5aa9
Parents:
d779a1a
git-author:
Anders Kaseorg <andersk@mit.edu> (12/25/13 11:18:38)
git-committer:
Anders Kaseorg <andersk@mit.edu> (12/25/13 11:33:37)
Message:
Use the Glib slice allocator for fixed-size objects

The slice allocator, available since GLib 2.10, is more
space-efficient than [g_]malloc.  Since BarnOwl is obviously at the
leading edge of space-efficient technology, this seems like a natural
fit.  Use it for every fixed-size object except
owl_viewwin_search_data (which would need an extra destroy_cbdata
function to g_slice_free it).

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • global.c

    r120dac7 r7dcef03  
    553553  e->g->filterlist = g_list_remove(e->g->filterlist, e->f);
    554554  owl_filter_delete(e->f);
    555   g_free(e);
     555  g_slice_free(owl_global_filter_ent, e);
    556556}
    557557
    558558void owl_global_add_filter(owl_global *g, owl_filter *f) {
    559   owl_global_filter_ent *e = g_new(owl_global_filter_ent, 1);
     559  owl_global_filter_ent *e = g_slice_new(owl_global_filter_ent);
    560560  e->g = g;
    561561  e->f = f;
Note: See TracChangeset for help on using the changeset viewer.