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/input.c

    r2288 r2290  
    343343/*dprintf("*** calling pushstring: %s, %d\n", s, len);*/
    344344        if (psh->parsefile->strpush) {
    345                 sp = ckmalloc(sizeof (struct strpush));
     345                sp = ckmalloc(psh, sizeof (struct strpush));
    346346                sp->prev = psh->parsefile->strpush;
    347347                psh->parsefile->strpush = sp;
     
    373373        psh->parsefile->strpush = sp->prev;
    374374        if (sp != &(psh->parsefile->basestrpush))
    375                 ckfree(sp);
     375                ckfree(psh, sp);
    376376        INTON;
    377377}
     
    415415        if (push) {
    416416                pushfile(psh);
    417                 psh->parsefile->buf = ckmalloc(BUFSIZ);
     417                psh->parsefile->buf = ckmalloc(psh, BUFSIZ);
    418418        }
    419419        if (psh->parsefile->fd > 0)
     
    421421        psh->parsefile->fd = fd;
    422422        if (psh->parsefile->buf == NULL)
    423                 psh->parsefile->buf = ckmalloc(BUFSIZ);
     423                psh->parsefile->buf = ckmalloc(psh, BUFSIZ);
    424424        psh->parselleft = psh->parsenleft = 0;
    425425        psh->plinno = 1;
     
    460460        psh->parsefile->nextc = psh->parsenextc;
    461461        psh->parsefile->linno = psh->plinno;
    462         pf = (struct parsefile *)ckmalloc(sizeof (struct parsefile));
     462        pf = (struct parsefile *)ckmalloc(psh, sizeof (struct parsefile));
    463463        pf->prev = psh->parsefile;
    464464        pf->fd = -1;
     
    478478                shfile_close(&psh->fdtab, pf->fd);
    479479        if (pf->buf)
    480                 ckfree(pf->buf);
     480                ckfree(psh, pf->buf);
    481481        while (pf->strpush)
    482482                popstring(psh);
    483483        psh->parsefile = pf->prev;
    484         ckfree(pf);
     484        ckfree(psh, pf);
    485485        psh->parsenleft = psh->parsefile->nleft;
    486486        psh->parselleft = psh->parsefile->lleft;
Note: See TracChangeset for help on using the changeset viewer.