# 2.11BSD#431 - /usr/src/ucb/pascal/px/palloc.c

##### Functions

    alloc             X
    free              X
    setmem            X
    stklim            X

       1: #include "0x.h"
       2: #include "E.h"
       3:
       4: extern char *sbrk(), *brk();
       5:
       6: alloc(need)
       7:     char *need;
       8: {
       9:     register cnt, *wp;
      10:     register char *have;
      11:
      12:     need = (char *)((unsigned)(need+1) &~ 1);
      13:     if ((have=high-memptr) < need) {
      14:         if (sbrk(need > have + 1024 ? need-have:1024) == -1)
      15:             error(EOUTOFMEM);
      16:         high = sbrk(0);
      17:     }
      18:     wp = memptr;
      19:     cnt = ((unsigned)need >> 1) & 077777;
      20:     do {
      21:         *wp++ = 0;
      22:     } while (--cnt);
      23:     wp = memptr;
      24:     memptr += (unsigned)need;
      25:     stklim();
      26:     return(wp);
      27: }
      28:
      29: setmem()
      30: {
      31:     high = bottmem = memptr = sbrk(0);
      32:     stklim();
      33: }
      34:
      35: free(cptr)
      36:     char *cptr;
      37: {
      38: }
      39:
      40: stklim()
      41: {
      42:     maxstk = (char *)((((unsigned)memptr + 07777) &~ 07777) + 512);
      43: }

#### Defined functions

alloc defined in line 6; used 6 times

- in /usr/src/ucb/pascal/px/00int.s line 6
- in /usr/src/ucb/pascal/px/24pxp.s line 12
- in /usr/src/ucb/pascal/px/30getname.s line 41, 176
- in /usr/src/ucb/pascal/px/34fun.s line 98
- in /usr/src/ucb/pascal/px/int.c line 83

free defined in line 35; used 6 times

- in /usr/src/ucb/pascal/px/00int.s line 6, 299-303(2)
- in /usr/src/ucb/pascal/px/30getname.s line 189, 219
- in /usr/src/ucb/pascal/px/34fun.s line 89

setmem defined in line 29; used 1 times

- in /usr/src/ucb/pascal/px/int.c line 32

stklim defined in line 40; used 2 times

- in line 25, 32

Last modified: 1986-05-31 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 946 |