Ignore:
Timestamp:
Feb 27, 2009, 5:08:07 AM (16 years ago)
Author:
bird
Message:

kash: malloc/free/friends gets a psh.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/alias.c

    r1233 r2290  
    7171                if (equal(name, ap->name)) {
    7272                        INTOFF;
    73                         ckfree(ap->val);
    74                         ap->val = savestr(val);
     73                        ckfree(psh, ap->val);
     74                        ap->val = savestr(psh, val);
    7575                        INTON;
    7676                        return;
     
    7979        /* not found */
    8080        INTOFF;
    81         ap = ckmalloc(sizeof (struct alias));
    82         ap->name = savestr(name);
     81        ap = ckmalloc(psh, sizeof (struct alias));
     82        ap->name = savestr(psh, name);
    8383        /*
    8484         * XXX - HACK: in order that the parser will not finish reading the
     
    9999         */
    100100#ifdef notyet
    101         ap->val = savestr(val);
     101        ap->val = savestr(psh, val);
    102102#else /* hack */
    103103        {
    104104        size_t len = strlen(val);
    105         ap->val = ckmalloc(len + 2);
     105        ap->val = ckmalloc(psh, len + 2);
    106106        memcpy(ap->val, val, len);
    107107        ap->val[len] = ' ';     /* fluff */
     
    135135                                INTOFF;
    136136                                *app = ap->next;
    137                                 ckfree(ap->name);
    138                                 ckfree(ap->val);
    139                                 ckfree(ap);
     137                                ckfree(psh, ap->name);
     138                                ckfree(psh, ap->val);
     139                                ckfree(psh, ap);
    140140                                INTON;
    141141                        }
     
    166166                psh->atab[i] = NULL;
    167167                while (ap) {
    168                         ckfree(ap->name);
    169                         ckfree(ap->val);
     168                        ckfree(psh, ap->name);
     169                        ckfree(psh, ap->val);
    170170                        tmp = ap;
    171171                        ap = ap->next;
    172                         ckfree(tmp);
     172                        ckfree(psh, tmp);
    173173                }
    174174        }
Note: See TracChangeset for help on using the changeset viewer.