Changeset 96828e4 for editwin.c


Ignore:
Timestamp:
Feb 11, 2011, 4:31:33 PM (13 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, release-1.8, release-1.9
Children:
35b6eb9
Parents:
9518a85
git-author:
Anders Kaseorg <andersk@mit.edu> (08/27/09 00:51:45)
git-committer:
Anders Kaseorg <andersk@mit.edu> (02/11/11 16:31:33)
Message:
Replace owl_malloc with g_new and g_new0.

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

Legend:

Unmodified
Added
Removed
  • editwin.c

    r5f8ec6b r96828e4  
    7272static owl_editwin *owl_editwin_allocate(void)
    7373{
    74   owl_editwin *e;
    75   e = owl_malloc(sizeof(owl_editwin));
    76   memset(e, 0, sizeof(*e));
     74  owl_editwin *e = g_new0(owl_editwin, 1);
    7775  e->refcount = 1;
    7876  return e;
     
    123121                              owl_history *hist)
    124122{
    125   e->buff=owl_malloc(INCR);
     123  e->buff=g_new(char, INCR);
    126124  e->buff[0]='\0';
    127125  e->bufflen=0;
     
    303301
    304302  if (lock > 0) {
    305     locktext = owl_malloc(lock+1);
     303    locktext = g_new(char, lock+1);
    306304    strncpy(locktext, e->buff, lock);
    307305    locktext[lock] = 0;
     
    382380owl_editwin_excursion *owl_editwin_begin_excursion(owl_editwin *e)
    383381{
    384   owl_editwin_excursion *x = owl_malloc(sizeof *x);
     382  owl_editwin_excursion *x = g_new(owl_editwin_excursion, 1);
    385383  oe_save_excursion(e, x);
    386384  return x;
     
    747745    return;
    748746
    749   tmp = owl_malloc((end - start) + 1);
     747  tmp = g_new(char, (end - start) + 1);
    750748  tmp[(end - start)] = 0;
    751749  memcpy(tmp, middle, end - middle);
     
    10721070  char *killbuf = owl_global_get_kill_buffer(&g);
    10731071
    1074   p = owl_malloc(len + 1);
     1072  p = g_new(char, len + 1);
    10751073
    10761074  if (p != NULL) {
     
    14081406  char *p;
    14091407 
    1410   p = owl_malloc(end - start + 1);
     1408  p = g_new(char, end - start + 1);
    14111409  memcpy(p, e->buff + start, end - start);
    14121410  p[end - start] = 0;
Note: See TracChangeset for help on using the changeset viewer.