Changeset 7dcef03 for buddylist.c


Ignore:
Timestamp:
Dec 25, 2013, 11:33:37 AM (7 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master
Children:
8f95fc4, db1a2f8b, 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
  • buddylist.c

    r3cdd6d2 r7dcef03  
    1111{
    1212  owl_buddy *b;
    13   b=g_new(owl_buddy, 1);
     13  b=g_slice_new(owl_buddy);
    1414 
    1515  owl_buddy_create(b, OWL_PROTOCOL_AIM, screenname);
     
    5050
    5151    /* if not, create the login message */
    52     m=g_new(owl_message, 1);
     52    m=g_slice_new(owl_message);
    5353    owl_message_create_aim(m,
    5454                           screenname,
     
    6969
    7070  if (owl_buddylist_is_aim_buddy_loggedin(bl, screenname)) {
    71     m=g_new(owl_message, 1);
     71    m=g_slice_new(owl_message);
    7272    owl_message_create_aim(m,
    7373                           screenname,
Note: See TracChangeset for help on using the changeset viewer.