use-gslice.diff
author Myhailo Danylenko <isbear@isbear.org.ua>
Fri, 09 Dec 2016 02:12:34 +0200
changeset 92 66f7e2aa040c
parent 87 78238d26911a
permissions -rw-r--r--
Add fix-compile-warning-xmpp_c, refresh queue
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     1
# HG changeset patch
87
78238d26911a Update series to current dev version
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
     2
# Parent c45500769f0c34734851c9079e57add63d083c25
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
     3
# Parent  a18571d686cd4eddcb55e356a8b82c0ac3990f49
87
78238d26911a Update series to current dev version
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
     4
Use glib slices to allocate constant-size blocks
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
     5
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
     6
diff -r a18571d686cd mcabber/mcabber/caps.c
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
     7
--- a/mcabber/mcabber/caps.c	Fri Dec 09 01:38:39 2016 +0200
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
     8
+++ b/mcabber/mcabber/caps.c	Fri Dec 09 01:48:31 2016 +0200
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
     9
@@ -50,7 +50,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    10
   g_hash_table_destroy(c->identities);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    11
   g_hash_table_destroy(c->features);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    12
   g_hash_table_destroy(c->forms);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    13
-  g_free(c);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    14
+  g_slice_free(caps, c);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    15
 }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    16
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    17
 void identity_destroy(gpointer data)
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
    18
@@ -59,14 +59,14 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    19
   g_free(i->category);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    20
   g_free(i->type);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    21
   g_free(i->name);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    22
-  g_free(i);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    23
+  g_slice_free(identity, i);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    24
 }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    25
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    26
 void form_destroy(gpointer data)
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    27
 {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    28
   dataform *f = data;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    29
   g_hash_table_destroy(f->fields);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    30
-  g_free(f);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    31
+  g_slice_free(dataform, f);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    32
 }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    33
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    34
 void field_destroy(gpointer data)
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
    35
@@ -95,7 +95,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    36
 {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    37
   if (!hash)
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    38
     return;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    39
-  caps *c = g_new0(caps, 1);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    40
+  caps *c = g_slice_new(caps);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    41
   c->features = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    42
   c->identities = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, identity_destroy);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    43
   c->forms = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, form_destroy);
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
    44
@@ -156,7 +156,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    45
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    46
   c = g_hash_table_lookup(caps_cache, hash);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    47
   if (c) {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    48
-    identity *i = g_new0(identity, 1);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    49
+    identity *i = g_slice_new(identity);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    50
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    51
     i->category = g_strdup(category);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    52
     i->name = g_strdup(name);
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
    53
@@ -180,7 +180,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    54
     return;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    55
   c = g_hash_table_lookup(caps_cache, hash);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    56
   if (c) {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    57
-    dataform *d = g_new0(dataform, 1);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    58
+    dataform *d = g_slice_new(dataform);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    59
     char *f = g_strdup(formtype);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    60
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    61
     d->fields = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, field_destroy);
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
    62
diff -r a18571d686cd mcabber/mcabber/commands.c
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
    63
--- a/mcabber/mcabber/commands.c	Fri Dec 09 01:38:39 2016 +0200
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
    64
+++ b/mcabber/mcabber/commands.c	Fri Dec 09 01:48:31 2016 +0200
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
    65
@@ -113,7 +113,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    66
       gpointer userdata = command->userdata;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    67
       Commands = g_slist_delete_link(Commands, sl_cmd);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    68
       compl_del_category_word(COMPL_CMD, command->name);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    69
-      g_free(command);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    70
+      g_slice_free(cmd, command);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    71
       return userdata;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    72
     }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    73
   return NULL;
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
    74
@@ -125,7 +125,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    75
 gpointer cmd_add(const char *name, const char *help, guint flags_row1,
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    76
                  guint flags_row2, void (*f)(char*), gpointer userdata)
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    77
 {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    78
-  cmd *n_cmd = g_new0(cmd, 1);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    79
+  cmd *n_cmd = g_slice_new0(cmd);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    80
   strncpy(n_cmd->name, name, 32-1);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    81
   n_cmd->help = help;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    82
   n_cmd->completion_flags[0] = flags_row1;
87
78238d26911a Update series to current dev version
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
    83
@@ -1571,7 +1571,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    84
     return NULL;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    85
   }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    86
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    87
-  msgbuf = g_new0(char, HBB_BLOCKSIZE);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    88
+  msgbuf = g_slice_alloc0(HBB_BLOCKSIZE);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    89
   len = fread(msgbuf, 1, HBB_BLOCKSIZE-1, fd);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    90
   fclose(fd);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    91
 
87
78238d26911a Update series to current dev version
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
    92
@@ -1595,7 +1595,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    93
   if (*p || (size_t)(p-msgbuf) != len) { // We're not at the End Of Line...
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    94
     scr_LogPrint(LPRINT_LOGNORM, "Message file contains "
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    95
                  "invalid characters (%s)", filename);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    96
-    g_free(msgbuf);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    97
+    g_slice_free1(HBB_BLOCKSIZE, msgbuf);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    98
     return NULL;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
    99
   }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   100
 
87
78238d26911a Update series to current dev version
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
   101
@@ -1609,7 +1609,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   102
   // It could be empty, once the trailing newlines are gone
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   103
   if (p == msgbuf && *p == '\n') {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   104
     scr_LogPrint(LPRINT_LOGNORM, "Message file is empty (%s)", filename);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   105
-    g_free(msgbuf);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   106
+    g_slice_free1(HBB_BLOCKSIZE, msgbuf);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   107
     return NULL;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   108
   }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   109
 
87
78238d26911a Update series to current dev version
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
   110
@@ -1618,7 +1618,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   111
   if (!msgbuf_utf8 && msgbuf)
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   112
     scr_LogPrint(LPRINT_LOGNORM, "Message file charset conversion error (%s)",
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   113
                  filename);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   114
-  g_free(msgbuf);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   115
+  g_slice_free1(HBB_BLOCKSIZE, msgbuf);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   116
   return msgbuf_utf8;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   117
 }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   118
 
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   119
@@ -1921,7 +1921,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   120
   esub   = buddy_getsubscription(bud);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   121
   on_srv = buddy_getonserverflag(bud);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   122
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   123
-  buffer = g_new(char, 4096);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   124
+  buffer = g_slice_alloc(4096);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   125
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   126
   if (bjid) {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   127
     GSList *resources, *p_res;
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   128
@@ -2020,7 +2020,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   129
                  type == ROSTER_TYPE_GROUP ? "group" :
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   130
                  (type == ROSTER_TYPE_SPECIAL ? "special" : "unknown"));
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   131
   }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   132
-  g_free(buffer);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   133
+  g_slice_free1(4096, buffer);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   134
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   135
   // Tell the user if this item has an annotation.
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   136
   if (type == ROSTER_TYPE_USER ||
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   137
@@ -2069,7 +2069,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   138
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   139
   bjid = buddy_getjid(bud);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   140
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   141
-  buffer = g_new(char, 4096);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   142
+  buffer = g_slice_alloc(4096);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   143
   strncpy(buffer, "Room members:", 127);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   144
   scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO, 0);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   145
 
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   146
@@ -2129,7 +2129,7 @@
87
78238d26911a Update series to current dev version
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
   147
   scr_WriteIncomingMessage(bjid, buffer, 0, HBB_PREFIX_INFO, 0);
78238d26911a Update series to current dev version
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
   148
 
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   149
   g_slist_free(resources);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   150
-  g_free(buffer);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   151
+  g_slice_free1(4096, buffer);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   152
 }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   153
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   154
 static void move_group_member(gpointer bud, void *groupnamedata)
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   155
@@ -3163,7 +3163,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   156
   affil = buddy_getaffil(bud, nick);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   157
   realjid = buddy_getrjid(bud, nick);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   158
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   159
-  buffer = g_new(char, 4096);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   160
+  buffer = g_slice_alloc(4096);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   161
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   162
   snprintf(buffer, 4095, "Whois [%s]", nick);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   163
   scr_WriteIncomingMessage(bjid, buffer, 0, msg_flag, 0);
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   164
@@ -3193,7 +3193,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   165
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   166
   scr_WriteIncomingMessage(bjid, "End of WHOIS", 0, msg_flag, 0);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   167
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   168
-  g_free(buffer);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   169
+  g_slice_free1(4096, buffer);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   170
   g_free(nick);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   171
   if (paramlst)
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   172
     free_arg_lst(paramlst);
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   173
diff -r a18571d686cd mcabber/mcabber/events.c
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   174
--- a/mcabber/mcabber/events.c	Fri Dec 09 01:38:39 2016 +0200
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   175
+++ b/mcabber/mcabber/events.c	Fri Dec 09 01:48:31 2016 +0200
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   176
@@ -81,7 +81,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   177
     return NULL;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   178
   }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   179
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   180
-  event = g_new(evs_t, 1);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   181
+  event = g_slice_new(evs_t);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   182
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   183
   event->id          = stridn;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   184
   event->description = g_strdup(desc);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   185
@@ -134,7 +134,7 @@
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   186
   evs_list = g_slist_remove(evs_list, event);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   187
   g_free(event->id);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   188
   g_free(event->description);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   189
-  g_free(event);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   190
+  g_slice_free(evs_t, event);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   191
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   192
   return 0; // Ok, deleted
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   193
 }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   194
@@ -213,7 +213,7 @@
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   195
     evs_list = g_slist_remove(evs_list, event);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   196
     g_free(event->id);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   197
     g_free(event->description);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   198
-    g_free(event);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   199
+    g_slice_free(evs_t, event);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   200
   }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   201
   g_slist_free(evs_list);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   202
   evs_list = NULL;
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   203
diff -r a18571d686cd mcabber/mcabber/hbuf.c
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   204
--- a/mcabber/mcabber/hbuf.c	Fri Dec 09 01:38:39 2016 +0200
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   205
+++ b/mcabber/mcabber/hbuf.c	Fri Dec 09 01:48:31 2016 +0200
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   206
@@ -27,7 +27,6 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   207
 #include "utf8.h"
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   208
 #include "screen.h"
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   209
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   210
-
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   211
 /* This is a private structure type */
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   212
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   213
 typedef struct {
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   214
@@ -57,7 +56,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   215
 {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   216
   GList *curr_elt = first_hbuf_elt;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   217
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   218
-  // Let's add non-persistent blocs if necessary
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   219
+  // Let's add non-persistent blocks if necessary
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   220
   // - If there are '\n' in the string
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   221
   // - If length > width (and width != 0)
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   222
   while (curr_elt) {
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   223
@@ -93,17 +92,21 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   224
       end = hbuf_b_curr->ptr_end;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   225
       hbuf_b_curr->ptr_end = br;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   226
       // Create another block
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   227
-      hbuf_b_curr = g_new0(hbuf_block, 1);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   228
+      hbuf_b_curr = g_slice_new(hbuf_block);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   229
       // The block must be persistent after a CR
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   230
       if (cr) {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   231
         hbuf_b_curr->ptr    = hbuf_b_prev->ptr_end + 1; // == cr+1
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   232
         hbuf_b_curr->flags  = HBB_FLAG_PERSISTENT;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   233
       } else {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   234
         hbuf_b_curr->ptr    = hbuf_b_prev->ptr_end; // == br
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   235
-        hbuf_b_curr->flags    = 0;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   236
+        hbuf_b_curr->flags  = 0;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   237
       }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   238
-      hbuf_b_curr->ptr_end  = end;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   239
+      hbuf_b_curr->ptr_end       = end;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   240
       hbuf_b_curr->ptr_end_alloc = hbuf_b_prev->ptr_end_alloc;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   241
+      hbuf_b_curr->prefix.timestamp  = 0;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   242
+      hbuf_b_curr->prefix.flags      = 0;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   243
+      hbuf_b_curr->prefix.mucnicklen = 0;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   244
+      hbuf_b_curr->prefix.xep184     = NULL;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   245
       // This is OK because insert_before(NULL) == append():
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   246
       *p_hbuf = g_list_insert_before(*p_hbuf, curr_elt->next, hbuf_b_curr);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   247
     }
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   248
@@ -136,7 +139,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   249
   textlen = strlen(text);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   250
   hbb_blocksize = MAX(textlen+1, HBB_BLOCKSIZE);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   251
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   252
-  hbuf_block_elt = g_new0(hbuf_block, 1);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   253
+  hbuf_block_elt = g_slice_new(hbuf_block);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   254
   hbuf_block_elt->prefix.timestamp  = timestamp;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   255
   hbuf_block_elt->prefix.flags      = prefix_flags;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   256
   hbuf_block_elt->prefix.mucnicklen = mucnicklen;
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   257
@@ -144,7 +147,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   258
   if (!*p_hbuf) {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   259
     hbuf_block_elt->ptr  = g_new(char, hbb_blocksize);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   260
     if (!hbuf_block_elt->ptr) {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   261
-      g_free(hbuf_block_elt);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   262
+      g_slice_free(hbuf_block, hbuf_block_elt);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   263
       return;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   264
     }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   265
     hbuf_block_elt->flags  = HBB_FLAG_ALLOC | HBB_FLAG_PERSISTENT;
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   266
@@ -206,7 +209,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   267
                 g_free(hbuf_b_elt->ptr);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   268
               }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   269
             }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   270
-            g_free(hbuf_b_elt);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   271
+            g_slice_free(hbuf_block, hbuf_b_elt);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   272
             hbuf_head = *p_hbuf = g_list_delete_link(hbuf_head, hbuf_elt);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   273
           }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   274
           n--;
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   275
@@ -243,7 +246,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   276
     if (hbuf_b_elt->flags & HBB_FLAG_ALLOC) {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   277
       g_free(hbuf_b_elt->ptr);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   278
     }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   279
-    g_free(hbuf_b_elt);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   280
+    g_slice_free(hbuf_block, hbuf_b_elt);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   281
   }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   282
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   283
   g_list_free(first_elt);
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   284
@@ -273,7 +276,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   285
     // Is next line not-persistent?
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   286
     if (!(hbuf_b_next->flags & HBB_FLAG_PERSISTENT)) {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   287
       hbuf_b_curr->ptr_end = hbuf_b_next->ptr_end;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   288
-      g_free(hbuf_b_next);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   289
+      g_slice_free(hbuf_block, hbuf_b_next);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   290
       curr_elt = g_list_delete_link(curr_elt, next_elt);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   291
     } else
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   292
       curr_elt = next_elt;
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   293
@@ -307,8 +310,8 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   294
 //  hbuf_get_lines(hbuf, n)
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   295
 // Returns an array of n hbb_line pointers
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   296
 // (The first line will be the line currently pointed by hbuf)
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   297
-// Note: The caller should free the array, the hbb_line pointers and the
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   298
-// text pointers after use.
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   299
+// Note: The caller should g_free the array, g_slice_free hbb_line pointers
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   300
+// and g_free text pointers after use.
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   301
 hbb_line **hbuf_get_lines(GList *hbuf, unsigned int n)
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   302
 {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   303
   unsigned int i;
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   304
@@ -347,7 +350,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   305
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   306
       blk = (hbuf_block*)(hbuf->data);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   307
       maxlen = blk->ptr_end - blk->ptr;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   308
-      *array_elt = (hbb_line*)g_new(hbb_line, 1);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   309
+      *array_elt = (hbb_line*)g_slice_new(hbb_line);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   310
       (*array_elt)->timestamp  = blk->prefix.timestamp;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   311
       (*array_elt)->flags      = blk->prefix.flags;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   312
       (*array_elt)->mucnicklen = blk->prefix.mucnicklen;
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   313
diff -r a18571d686cd mcabber/mcabber/hooks.c
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   314
--- a/mcabber/mcabber/hooks.c	Fri Dec 09 01:38:39 2016 +0200
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   315
+++ b/mcabber/mcabber/hooks.c	Fri Dec 09 01:48:31 2016 +0200
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   316
@@ -99,7 +99,7 @@
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   317
                      gint priority, gpointer userdata)
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   318
 {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   319
   GSList **hqueue = NULL;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   320
-  hook_list_data_t *h = g_new(hook_list_data_t, 1);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   321
+  hook_list_data_t *h = g_slice_new(hook_list_data_t);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   322
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   323
   h->handler  = handler;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   324
   h->priority = priority;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   325
@@ -148,7 +148,7 @@
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   326
   el = g_slist_find_custom(*hqueue, &hid,
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   327
                            (GCompareFunc)_hk_queue_search_cb);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   328
   if (el) {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   329
-    g_free(el->data);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   330
+    g_slice_free(hook_list_data_t, el->data);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   331
     *hqueue = g_slist_delete_link(*hqueue, el);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   332
     // Remove hook hash table entry if the hook queue is empty
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   333
     if (!*hqueue)
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   334
diff -r a18571d686cd mcabber/mcabber/modules.c
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   335
--- a/mcabber/mcabber/modules.c	Fri Dec 09 01:38:39 2016 +0200
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   336
+++ b/mcabber/mcabber/modules.c	Fri Dec 09 01:48:31 2016 +0200
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   337
@@ -174,7 +174,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   338
   }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   339
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   340
   { // Register module
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   341
-    loaded_module_t *module = g_new(loaded_module_t, 1);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   342
+    loaded_module_t *module = g_slice_new(loaded_module_t);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   343
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   344
     module->refcount     = 1;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   345
     module->locked       = manual;
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   346
@@ -265,7 +265,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   347
   // Output this here, as arg may point to module->name
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   348
   scr_LogPrint(LPRINT_LOGNORM, "Unloaded module %s.", module->name);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   349
   g_free(module->name);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   350
-  g_free(module);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   351
+  g_slice_free(loaded_module_t, module);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   352
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   353
   return NULL;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   354
 }
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   355
diff -r a18571d686cd mcabber/mcabber/screen.c
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   356
--- a/mcabber/mcabber/screen.c	Fri Dec 09 01:38:39 2016 +0200
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   357
+++ b/mcabber/mcabber/screen.c	Fri Dec 09 01:48:31 2016 +0200
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   358
@@ -1368,7 +1368,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   359
         wattrset(win_entry->win, get_color(COLOR_GENERAL));
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   360
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   361
       g_free(line->text);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   362
-      g_free(line);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   363
+      g_slice_free(hbb_line, line);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   364
     } else {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   365
       wclrtobot(win_entry->win);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   366
       break;
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   367
@@ -1382,7 +1382,7 @@
87
78238d26911a Update series to current dev version
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
   368
       scr_buffer_scroll_lock(1);
78238d26911a Update series to current dev version
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
   369
     }
78238d26911a Update series to current dev version
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
   370
     g_free(line->text);
78238d26911a Update series to current dev version
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
   371
-    g_free(line);
78238d26911a Update series to current dev version
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
   372
+    g_slice_free(hbb_line, line);
78238d26911a Update series to current dev version
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
   373
   } else if (autolock && win_entry->bd->lock) {
78238d26911a Update series to current dev version
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
   374
     scr_buffer_scroll_lock(0);
78238d26911a Update series to current dev version
Myhailo Danylenko <isbear@ukrpost.net>
parents: 85
diff changeset
   375
   }
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   376
diff -r a18571d686cd mcabber/mcabber/settings.c
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   377
--- a/mcabber/mcabber/settings.c	Fri Dec 09 01:38:39 2016 +0200
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   378
+++ b/mcabber/mcabber/settings.c	Fri Dec 09 01:48:31 2016 +0200
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   379
@@ -528,7 +528,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   380
     // If value is 0, we do not need to create a structure (that's
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   381
     // the default value).
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   382
     if (value) {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   383
-      pgpdata = g_new0(T_pgpopt, 1);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   384
+      pgpdata = g_slice_new0(T_pgpopt);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   385
       pgpdata->pgp_disabled = value;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   386
       g_hash_table_insert(pgpopt, g_strdup(bjid), pgpdata);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   387
     }
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   388
@@ -568,7 +568,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   389
     // If value is 0, we do not need to create a structure (that's
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   390
     // the default value).
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   391
     if (value) {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   392
-      pgpdata = g_new0(T_pgpopt, 1);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   393
+      pgpdata = g_slice_new0(T_pgpopt);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   394
       pgpdata->pgp_force = value;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   395
       g_hash_table_insert(pgpopt, g_strdup(bjid), pgpdata);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   396
     }
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   397
@@ -608,7 +608,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   398
     // If keyid is NULL, we do not need to create a structure (that's
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   399
     // the default value).
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   400
     if (keyid) {
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   401
-      pgpdata = g_new0(T_pgpopt, 1);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   402
+      pgpdata = g_slice_new0(T_pgpopt);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   403
       pgpdata->pgp_keyid = g_strdup(keyid);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   404
       g_hash_table_insert(pgpopt, g_strdup(bjid), pgpdata);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   405
     }
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   406
diff -r a18571d686cd mcabber/mcabber/xmpp_iq.c
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   407
--- a/mcabber/mcabber/xmpp_iq.c	Fri Dec 09 01:38:39 2016 +0200
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   408
+++ b/mcabber/mcabber/xmpp_iq.c	Fri Dec 09 01:48:31 2016 +0200
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   409
@@ -791,7 +791,7 @@
85
93c3cc0d7891 [refresh] Add round-high-priority.diff, refresh => API 41-42
Myhailo Danylenko <isbear@ukrpost.net>
parents: 36
diff changeset
   410
     return LM_HANDLER_RESULT_REMOVE_MESSAGE;
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   411
   }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   412
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   413
-  buf = g_new0(char, 512);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   414
+  buf = g_slice_alloc(512);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   415
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   416
   r = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   417
   query = lm_message_node_add_child(r->node, "query", NULL);
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   418
@@ -818,7 +818,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   419
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   420
   lm_connection_send(c, r, NULL);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   421
   lm_message_unref(r);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   422
-  g_free(buf);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   423
+  g_slice_free1(512, buf);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   424
   return LM_HANDLER_RESULT_REMOVE_MESSAGE;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   425
 }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   426
 
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   427
@@ -846,7 +846,7 @@
85
93c3cc0d7891 [refresh] Add round-high-priority.diff, refresh => API 41-42
Myhailo Danylenko <isbear@ukrpost.net>
parents: 36
diff changeset
   428
     return LM_HANDLER_RESULT_REMOVE_MESSAGE;
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   429
   }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   430
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   431
-  buf = g_new0(char, 512);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   432
+  buf = g_slice_alloc(512);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   433
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   434
   r = lm_message_new_iq_from_query(m, LM_MESSAGE_SUB_TYPE_RESULT);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   435
   query = lm_message_node_add_child(r->node, "time", NULL);
92
66f7e2aa040c Add fix-compile-warning-xmpp_c, refresh queue
Myhailo Danylenko <isbear@isbear.org.ua>
parents: 87
diff changeset
   436
@@ -883,7 +883,7 @@
33
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   437
 
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   438
   lm_connection_send(c, r, NULL);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   439
   lm_message_unref(r);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   440
-  g_free(buf);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   441
+  g_slice_free1(512, buf);
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   442
   return LM_HANDLER_RESULT_REMOVE_MESSAGE;
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   443
 }
ce47dc7fc6c0 Add use-gslice and templates
Myhailo Danylenko <isbear@ukrpost.net>
parents:
diff changeset
   444