memalloc.c File Reference

#include "shell.h"
#include "output.h"
#include "memalloc.h"
#include "error.h"
#include "machdep.h"
#include "mystring.h"

Include dependency graph for memalloc.c:

Go to the source code of this file.

Data Structures

struct  stack_block

Defines

#define MINSIZE   504

Functions

pointer ckmalloc (nbytes)
pointer ckrealloc (pointer p, nbytes)
char * savestr (char *s)
pointer stalloc (nbytes)
void stunalloc (pointer p)
void setstackmark (struct stackmark *mark)
void popstackmark (struct stackmark *mark)
void growstackblock ()
void grabstackblock (len)
char * growstackstr ()
char * makestrspace ()
void ungrabstackstr (char *s, char *p)

Variables

static char sccsid [] = "@(#)memalloc.c 5.2 (Berkeley) 3/13/91"
stack_block stackbase
stack_blockstackp = &stackbase
char * stacknxt = stackbase.space
int stacknleft = MINSIZE
int sstrnleft
int herefd = -1


Define Documentation

#define MINSIZE   504
 

Definition at line 104 of file memalloc.c.

Referenced by growstackblock(), and stalloc().


Function Documentation

pointer ckmalloc nbytes   ) 
 

Definition at line 53 of file memalloc.c.

References error, malloc(), nbytes, NULL, and p.

Referenced by addchar(), commandtext(), emptyoutbuf(), expandmeta(), makejob(), mklocal(), pushfile(), recordregion(), redirect(), savestr(), setinputfd(), setparam(), and stalloc().

pointer ckrealloc pointer  p,
nbytes 
 

Definition at line 68 of file memalloc.c.

References error, nbytes, NULL, and realloc().

Referenced by emptyoutbuf(), and growstackblock().

void grabstackblock len   ) 
 

Definition at line 229 of file memalloc.c.

References ALIGN, stacknleft, and stacknxt.

void growstackblock  ) 
 

Definition at line 201 of file memalloc.c.

References bcopy, ckrealloc(), INTOFF, INTON, MINSIZE, p, sp, stack_block::space, stackbase, stacknleft, stacknxt, stackp, and stalloc().

Referenced by growstackstr(), makestrspace(), and padvance().

char* growstackstr  ) 
 

Definition at line 257 of file memalloc.c.

References growstackblock(), herefd, sstrnleft, stackblock, stackblocksize, and xwrite().

char* makestrspace  ) 
 

Definition at line 275 of file memalloc.c.

References growstackblock(), sstrnleft, stackblock, and stackblocksize.

void popstackmark struct stackmark mark  ) 
 

Definition at line 173 of file memalloc.c.

References ckfree, INTOFF, INTON, sp, stacknleft, stacknxt, and stackp.

Referenced by casematch(), evalbackcmd(), evalcase(), evalcommand(), evalfor(), evalstring(), and main().

char* savestr char *  s  ) 
 

Definition at line 84 of file memalloc.c.

References ckmalloc(), p, savestr, scopy, and strlen().

void setstackmark struct stackmark mark  ) 
 

Definition at line 163 of file memalloc.c.

References stacknleft, stacknxt, and stackp.

Referenced by casematch(), chkmail(), cmdloop(), evalbackcmd(), evalcase(), evalcommand(), evalfor(), evalstring(), and main().

pointer stalloc nbytes   ) 
 

Definition at line 122 of file memalloc.c.

References ALIGN, ckmalloc(), INTOFF, INTON, MINSIZE, nbytes, p, sp, stacknleft, stacknxt, and stackp.

void stunalloc pointer  p  ) 
 

Definition at line 149 of file memalloc.c.

References abort(), NULL, stacknleft, stacknxt, and write.

Referenced by find_command(), printentry(), and shellexec().

void ungrabstackstr char *  s,
char *  p
 

Definition at line 285 of file memalloc.c.

References sstrnleft, stacknleft, and stacknxt.

Referenced by expbackq().


Variable Documentation

int herefd = -1
 

Definition at line 117 of file memalloc.c.

Referenced by evalvar(), expandhere(), expbackq(), and growstackstr().

char sccsid[] = "@(#)memalloc.c 5.2 (Berkeley) 3/13/91" [static]
 

Definition at line 38 of file memalloc.c.

int sstrnleft
 

Definition at line 116 of file memalloc.c.

Referenced by growstackstr(), makestrspace(), and ungrabstackstr().

struct stack_block stackbase
 

Definition at line 112 of file memalloc.c.

Referenced by growstackblock().

int stacknleft = MINSIZE
 

Definition at line 115 of file memalloc.c.

Referenced by grabstackblock(), growstackblock(), popstackmark(), setstackmark(), stalloc(), stunalloc(), and ungrabstackstr().

char* stacknxt = stackbase.space
 

Definition at line 114 of file memalloc.c.

Referenced by grabstackblock(), growstackblock(), popstackmark(), setstackmark(), stalloc(), stunalloc(), and ungrabstackstr().

struct stack_block* stackp = &stackbase
 

Definition at line 113 of file memalloc.c.

Referenced by decompress(), growstackblock(), popstackmark(), re_compile(), setstackmark(), and stalloc().


Generated on Fri Apr 14 22:58:54 2006 for minix by  doxygen 1.4.6