Changeset 7dcef03
- Timestamp:
- Dec 25, 2013, 11:33:37 AM (11 years ago)
- 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)
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
aim.c
r8258ea5 r7dcef03 1049 1049 wrapmsg=owl_text_wordwrap(stripmsg, 70); 1050 1050 nz_screenname=owl_aim_normalize_screenname(userinfo->sn); 1051 m=g_ new(owl_message, 1);1051 m=g_slice_new(owl_message); 1052 1052 owl_message_create_aim(m, 1053 1053 nz_screenname, -
buddy.c
rd4927a7 r7dcef03 72 72 { 73 73 owl_buddy_cleanup(b); 74 g_ free(b);74 g_slice_free(owl_buddy, b); 75 75 } -
buddylist.c
r3cdd6d2 r7dcef03 11 11 { 12 12 owl_buddy *b; 13 b=g_ new(owl_buddy, 1);13 b=g_slice_new(owl_buddy); 14 14 15 15 owl_buddy_create(b, OWL_PROTOCOL_AIM, screenname); … … 50 50 51 51 /* if not, create the login message */ 52 m=g_ new(owl_message, 1);52 m=g_slice_new(owl_message); 53 53 owl_message_create_aim(m, 54 54 screenname, … … 69 69 70 70 if (owl_buddylist_is_aim_buddy_loggedin(bl, screenname)) { 71 m=g_ new(owl_message, 1);71 m=g_slice_new(owl_message); 72 72 owl_message_create_aim(m, 73 73 screenname, -
cmd.c
rf271129 r7dcef03 35 35 void owl_cmddict_add_alias(owl_cmddict *cd, const char *alias_from, const char *alias_to) { 36 36 owl_cmd *cmd; 37 cmd = g_ new(owl_cmd, 1);37 cmd = g_slice_new(owl_cmd); 38 38 owl_cmd_create_alias(cmd, alias_from, alias_to); 39 39 owl_perlconfig_new_command(cmd->name); … … 42 42 43 43 int owl_cmddict_add_cmd(owl_cmddict *cd, const owl_cmd * cmd) { 44 owl_cmd * newcmd = g_ new(owl_cmd, 1);44 owl_cmd * newcmd = g_slice_new(owl_cmd); 45 45 if(owl_cmd_create_from_template(newcmd, cmd) < 0) { 46 g_ free(newcmd);46 g_slice_free(owl_cmd, newcmd); 47 47 return -1; 48 48 } … … 141 141 { 142 142 owl_cmd_cleanup(cmd); 143 g_ free(cmd);143 g_slice_free(owl_cmd, cmd); 144 144 } 145 145 -
context.c
rf271129 r7dcef03 10 10 if (!(mode & OWL_CTX_MODE_BITS)) 11 11 mode |= OWL_CTX_INTERACTIVE; 12 c = g_ new0(owl_context, 1);12 c = g_slice_new0(owl_context); 13 13 c->mode = mode; 14 14 c->data = data; … … 71 71 if (ctx->delete_cb) 72 72 ctx->delete_cb(ctx); 73 g_ free(ctx);73 g_slice_free(owl_context, ctx); 74 74 } -
editwin.c
r8258ea5 r7dcef03 68 68 static CALLER_OWN owl_editwin *owl_editwin_allocate(void) 69 69 { 70 owl_editwin *e = g_ new0(owl_editwin, 1);70 owl_editwin *e = g_slice_new0(owl_editwin); 71 71 e->refcount = 1; 72 72 return e; … … 87 87 oe_destroy_cbdata(e); 88 88 89 g_ free(e);89 g_slice_free(owl_editwin, e); 90 90 } 91 91 … … 373 373 owl_editwin_excursion *owl_editwin_begin_excursion(owl_editwin *e) 374 374 { 375 owl_editwin_excursion *x = g_ new(owl_editwin_excursion, 1);375 owl_editwin_excursion *x = g_slice_new(owl_editwin_excursion); 376 376 oe_save_excursion(e, x); 377 377 return x; … … 381 381 { 382 382 oe_restore_excursion(e, x); 383 g_ free(x);383 g_slice_free(owl_editwin_excursion, x); 384 384 } 385 385 -
filter.c
rc068c03 r7dcef03 18 18 owl_filter *f; 19 19 20 f = g_ new(owl_filter, 1);20 f = g_slice_new(owl_filter); 21 21 22 22 f->name=g_strdup(name); … … 69 69 if(!argc) return NULL; 70 70 71 fe = g_ new(owl_filterelement, 1);71 fe = g_slice_new(owl_filterelement); 72 72 owl_filterelement_create(fe); 73 73 … … 114 114 err: 115 115 owl_filterelement_cleanup(fe); 116 g_ free(fe);116 g_slice_free(owl_filterelement, fe); 117 117 return NULL; 118 118 } … … 132 132 op2 = owl_filter_parse_primitive_expression(argc-i-1, argv+i+1, &skip); 133 133 if(!op2) goto err; 134 tmp = g_ new(owl_filterelement, 1);134 tmp = g_slice_new(owl_filterelement); 135 135 if(!strcasecmp(argv[i], "and")) { 136 136 owl_filterelement_create_and(tmp, op1, op2); … … 152 152 if(op1) { 153 153 owl_filterelement_cleanup(op1); 154 g_ free(op1);154 g_slice_free(owl_filterelement, op1); 155 155 } 156 156 return NULL; … … 262 262 if (f->root) { 263 263 owl_filterelement_cleanup(f->root); 264 g_ free(f->root);264 g_slice_free(owl_filterelement, f->root); 265 265 } 266 266 if (f->name) 267 267 g_free(f->name); 268 g_ free(f);269 } 268 g_slice_free(owl_filter, f); 269 } -
filterelement.c
r7756dde r7dcef03 328 328 if (fe->left) { 329 329 owl_filterelement_cleanup(fe->left); 330 g_ free(fe->left);330 g_slice_free(owl_filterelement, fe->left); 331 331 } 332 332 if (fe->right) { 333 333 owl_filterelement_cleanup(fe->right); 334 g_ free(fe->right);334 g_slice_free(owl_filterelement, fe->right); 335 335 } 336 336 owl_regex_cleanup(&(fe->re)); -
functions.c
rc55930e r7dcef03 196 196 owl_message *m; 197 197 198 m=g_ new(owl_message, 1);198 m=g_slice_new(owl_message); 199 199 owl_message_create_admin(m, header, body); 200 200 … … 218 218 if (z->cc && owl_zwrite_is_personal(z)) { 219 219 /* create the message */ 220 owl_message *m = g_ new(owl_message, 1);220 owl_message *m = g_slice_new(owl_message); 221 221 owl_message_create_from_zwrite(m, z, owl_zwrite_get_message(z), 0); 222 222 … … 231 231 232 232 /* create the message */ 233 m = g_ new(owl_message, 1);233 m = g_slice_new(owl_message); 234 234 owl_message_create_from_zwrite(m, z, owl_zwrite_get_message(z), i); 235 235 … … 251 251 if (!owl_global_is_aimloggedin(&g)) return(NULL); 252 252 253 m=g_ new(owl_message, 1);253 m=g_slice_new(owl_message); 254 254 owl_message_create_aim(m, 255 255 owl_global_get_aim_screenname(&g), … … 270 270 271 271 /* create the message */ 272 m=g_ new(owl_message, 1);272 m=g_slice_new(owl_message); 273 273 owl_message_create_loopback(m, body); 274 274 owl_message_set_direction_out(m); … … 516 516 /* create a message and put it on the message queue. This simulates 517 517 * an incoming message */ 518 min=g_ new(owl_message, 1);518 min=g_slice_new(owl_message); 519 519 mout=owl_function_make_outgoing_loopback(msg); 520 520 … … 3482 3482 while (zaldptr) { 3483 3483 ZFreeALD(zaldptr->data); 3484 g_ free(zaldptr->data);3484 g_slice_free(ZAsyncLocateData_t, zaldptr->data); 3485 3485 zaldptr = g_list_next(zaldptr); 3486 3486 } … … 3492 3492 for (i = 0; i < anyone->len; i++) { 3493 3493 user = anyone->pdata[i]; 3494 zald = g_ new(ZAsyncLocateData_t, 1);3494 zald = g_slice_new(ZAsyncLocateData_t); 3495 3495 if (ZRequestLocations(zstr(user), zald, UNACKED, ZAUTH) == ZERR_NONE) { 3496 3496 *zaldlist = g_list_append(*zaldlist, zald); 3497 3497 } else { 3498 g_ free(zald);3498 g_slice_free(ZAsyncLocateData_t, zald); 3499 3499 } 3500 3500 } -
global.c
r120dac7 r7dcef03 553 553 e->g->filterlist = g_list_remove(e->g->filterlist, e->f); 554 554 owl_filter_delete(e->f); 555 g_ free(e);555 g_slice_free(owl_global_filter_ent, e); 556 556 } 557 557 558 558 void 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); 560 560 e->g = g; 561 561 e->f = f; -
keybinding.c
rf271129 r7dcef03 14 14 CALLER_OWN owl_keybinding *owl_keybinding_new(const char *keyseq, const char *command, void (*function_fn)(void), const char *desc) 15 15 { 16 owl_keybinding *kb = g_ new(owl_keybinding, 1);16 owl_keybinding *kb = g_slice_new(owl_keybinding); 17 17 18 18 owl_function_debugmsg("owl_keybinding_init: creating binding for <%s> with desc: <%s>", keyseq, desc); 19 19 if (command && function_fn) { 20 g_ free(kb);20 g_slice_free(owl_keybinding, kb); 21 21 return NULL; 22 22 } else if (command && !function_fn) { … … 29 29 30 30 if (owl_keybinding_make_keys(kb, keyseq) != 0) { 31 g_ free(kb);31 g_slice_free(owl_keybinding, kb); 32 32 return NULL; 33 33 } … … 70 70 g_free(kb->desc); 71 71 g_free(kb->command); 72 g_ free(kb);72 g_slice_free(owl_keybinding, kb); 73 73 } 74 74 -
keymap.c
rf271129 r7dcef03 189 189 { 190 190 owl_keymap *km; 191 km = g_ new(owl_keymap, 1);191 km = g_slice_new(owl_keymap); 192 192 owl_keymap_init(km, name, desc, default_fn, prealways_fn, postalways_fn); 193 193 owl_keyhandler_add_keymap(kh, km); -
logging.c
r0792d99 r7dcef03 177 177 g_free(msg->message); 178 178 g_free(msg->filename); 179 g_ free(msg);179 g_slice_free(owl_log_entry, msg); 180 180 } 181 181 } … … 184 184 { 185 185 owl_log_entry *log_msg = NULL; 186 log_msg = g_ new(owl_log_entry,1);186 log_msg = g_slice_new(owl_log_entry); 187 187 log_msg->message = g_strdup(buffer); 188 188 log_msg->filename = g_strdup(filename); … … 266 266 * owl_log_shouldlog_message(void) 267 267 */ 268 m = g_ new(owl_message, 1);268 m = g_slice_new(owl_message); 269 269 /* recip_index = 0 because there can only be one recipient anyway */ 270 270 owl_message_create_from_zwrite(m, zw, text, 0); -
mainwin.c
rab88b05 r7dcef03 6 6 CALLER_OWN owl_mainwin *owl_mainwin_new(owl_window *window) 7 7 { 8 owl_mainwin *mw = g_ new(owl_mainwin, 1);8 owl_mainwin *mw = g_slice_new(owl_mainwin); 9 9 mw->curtruncated=0; 10 10 mw->lastdisplayed=-1; -
message.c
r2354e9a r7dcef03 70 70 71 71 if(pair == NULL) { 72 pair = g_ new(owl_pair, 1);72 pair = g_slice_new(owl_pair); 73 73 owl_pair_create(pair, attrname, NULL); 74 74 g_ptr_array_add(m->attributes, pair); … … 1019 1019 p = m->attributes->pdata[i]; 1020 1020 g_free(owl_pair_get_value(p)); 1021 g_ free(p);1021 g_slice_free(owl_pair, p); 1022 1022 } 1023 1023 … … 1030 1030 { 1031 1031 owl_message_cleanup(m); 1032 g_ free(m);1033 } 1032 g_slice_free(owl_message, m); 1033 } -
messagelist.c
r219f52c r7dcef03 3 3 CALLER_OWN owl_messagelist *owl_messagelist_new(void) 4 4 { 5 owl_messagelist *ml = g_ new(owl_messagelist, 1);5 owl_messagelist *ml = g_slice_new(owl_messagelist); 6 6 ml->list = g_ptr_array_new(); 7 7 return ml; … … 13 13 g_ptr_array_foreach(ml->list, (GFunc)owl_message_delete, NULL); 14 14 g_ptr_array_free(ml->list, true); 15 g_ free(ml);15 g_slice_free(owl_messagelist, ml); 16 16 } 17 17 -
perlconfig.c
rca1fb26a r7dcef03 188 188 hash = (HV*)SvRV(msg); 189 189 190 m = g_ new(owl_message, 1);190 m = g_slice_new(owl_message); 191 191 owl_message_init(m); 192 192 -
perlglue.xs
rae2b830 r7dcef03 232 232 CODE: 233 233 { 234 s = g_ new(owl_style, 1);234 s = g_slice_new(owl_style); 235 235 owl_style_create_perl(s, name, newSVsv(object)); 236 236 owl_global_add_style(&g, s); -
popexec.c
re146cd7 r7dcef03 23 23 } 24 24 25 pe = g_ new(owl_popexec, 1);25 pe = g_slice_new(owl_popexec); 26 26 pe->winactive=0; 27 27 pe->pid=0; … … 179 179 if (pe->refcount<=0) { 180 180 owl_function_debugmsg("doing free of %p", pe); 181 g_ free(pe);181 g_slice_free(owl_popexec, pe); 182 182 } 183 183 } -
popwin.c
r6829afc r7dcef03 3 3 CALLER_OWN owl_popwin *owl_popwin_new(void) 4 4 { 5 owl_popwin *pw = g_ new0(owl_popwin, 1);5 owl_popwin *pw = g_slice_new0(owl_popwin); 6 6 7 7 pw->border = owl_window_new(NULL); … … 92 92 g_object_unref(pw->content); 93 93 94 g_ free(pw);94 g_slice_free(owl_popwin, pw); 95 95 } 96 96 -
runtests.sh
r5db8835 r7dcef03 1 1 #!/bin/sh 2 export G_SLICE=debug-blocks 2 3 exec env HARNESS_PERL=./tester prove --failures "${srcdir:=$(dirname "$0")}/t/" -
select.c
r84a071f r7dcef03 41 41 if (t->destroy_cbdata) 42 42 t->destroy_cbdata(t->cbdata); 43 g_ free(t);43 g_slice_free(owl_task, t); 44 44 } 45 45 … … 47 47 { 48 48 GSource *source = g_idle_source_new(); 49 owl_task *t = g_ new0(owl_task, 1);49 owl_task *t = g_slice_new0(owl_task); 50 50 t->cb = cb; 51 51 t->cbdata = cbdata; -
style.c
r92ffd89 r7dcef03 103 103 { 104 104 owl_style_cleanup(s); 105 g_ free(s);105 g_slice_free(owl_style, s); 106 106 } -
variable.c
r9d4dfdc r7dcef03 627 627 628 628 static owl_variable *owl_variable_newvar(int type, const char *name, const char *summary, const char *description, const char *validsettings) { 629 owl_variable *var = g_ new0(owl_variable, 1);629 owl_variable *var = g_slice_new0(owl_variable); 630 630 var->type = type; 631 631 var->name = g_strdup(name); … … 793 793 g_closure_unref(v->set_fromstring_fn); 794 794 795 g_ free(v);795 g_slice_free(owl_variable, v); 796 796 } 797 797 -
viewwin.c
r7803326 r7dcef03 13 13 CALLER_OWN owl_viewwin *owl_viewwin_new_text(owl_window *win, const char *text) 14 14 { 15 owl_viewwin *v = g_ new0(owl_viewwin, 1);15 owl_viewwin *v = g_slice_new0(owl_viewwin); 16 16 owl_fmtext_init_null(&(v->fmtext)); 17 17 if (text) { … … 36 36 { 37 37 char *text; 38 owl_viewwin *v = g_ new0(owl_viewwin, 1);38 owl_viewwin *v = g_slice_new0(owl_viewwin); 39 39 40 40 owl_fmtext_copy(&(v->fmtext), fmtext); … … 424 424 g_object_unref(v->status); 425 425 owl_fmtext_cleanup(&(v->fmtext)); 426 g_ free(v);427 } 426 g_slice_free(owl_viewwin, v); 427 } -
zephyr.c
rebcdf4d r7dcef03 125 125 owl_zephyr_loadsubs_helper(subs->subs, subs->nsubs); 126 126 deferred_subs = g_list_delete_link(deferred_subs, deferred_subs); 127 g_ free(subs);127 g_slice_free(owl_sub_list, subs); 128 128 } 129 129 … … 261 261 g_free(subs); 262 262 } else { 263 owl_sub_list *s = g_ new(owl_sub_list, 1);263 owl_sub_list *s = g_slice_new(owl_sub_list); 264 264 s->subs = subs; 265 265 s->nsubs = count; … … 1413 1413 if (ret == ZERR_NONE) { 1414 1414 /* Send a PSEUDO LOGIN! */ 1415 m = g_ new(owl_message, 1);1415 m = g_slice_new(owl_message); 1416 1416 owl_message_create_pseudo_zlogin(m, 0, zald->user, 1417 1417 location.host, … … 1426 1426 /* Send a PSEUDO LOGOUT! */ 1427 1427 if (notify) { 1428 m = g_ new(owl_message, 1);1428 m = g_slice_new(owl_message); 1429 1429 owl_message_create_pseudo_zlogin(m, 1, zald->user, "", "", ""); 1430 1430 owl_global_messagequeue_addmsg(&g, m); … … 1435 1435 } 1436 1436 ZFreeALD(zald); 1437 g_ free(zald);1437 g_slice_free(ZAsyncLocateData_t, zald); 1438 1438 } 1439 1439 } … … 1502 1502 1503 1503 /* create the new message */ 1504 m=g_ new(owl_message, 1);1504 m=g_slice_new(owl_message); 1505 1505 owl_message_create_from_znotice(m, ¬ice); 1506 1506 -
zwrite.c
r919cbf2 r7dcef03 3 3 CALLER_OWN owl_zwrite *owl_zwrite_new_from_line(const char *line) 4 4 { 5 owl_zwrite *z = g_ new(owl_zwrite, 1);5 owl_zwrite *z = g_slice_new(owl_zwrite); 6 6 if (owl_zwrite_create_from_line(z, line) != 0) { 7 g_ free(z);7 g_slice_free(owl_zwrite, z); 8 8 return NULL; 9 9 } … … 13 13 CALLER_OWN owl_zwrite *owl_zwrite_new(int argc, const char *const *argv) 14 14 { 15 owl_zwrite *z = g_ new(owl_zwrite, 1);15 owl_zwrite *z = g_slice_new(owl_zwrite); 16 16 if (owl_zwrite_create(z, argc, argv) != 0) { 17 g_ free(z);17 g_slice_free(owl_zwrite, z); 18 18 return NULL; 19 19 } … … 356 356 { 357 357 owl_zwrite_cleanup(z); 358 g_ free(z);358 g_slice_free(owl_zwrite, z); 359 359 } 360 360
Note: See TracChangeset
for help on using the changeset viewer.