25 |
|
palloc(void) /* allocate a primitive */ |
26 |
|
|
27 |
|
{ |
28 |
< |
register PRIMITIVE *p; |
28 |
> |
register PRIMITIVE *p; |
29 |
|
|
30 |
< |
if (maxalloc > 0 && nalloc >= maxalloc) |
31 |
< |
return(NULL); |
30 |
> |
if (maxalloc > 0 && nalloc >= maxalloc) |
31 |
> |
return(NULL); |
32 |
|
|
33 |
< |
if ((p = pop(&freelist)) == NULL) |
34 |
< |
if (morefree()) |
35 |
< |
p = pop(&freelist); |
36 |
< |
else { |
37 |
< |
sprintf(errmsg, "out of memory in palloc (nalloc = %d)", nalloc); |
38 |
< |
error(SYSTEM, errmsg); |
39 |
< |
} |
33 |
> |
if ((p = pop(&freelist)) == NULL) { |
34 |
> |
if (morefree()) |
35 |
> |
p = pop(&freelist); |
36 |
> |
else { |
37 |
> |
sprintf(errmsg, "out of memory in palloc (nalloc = %d)", nalloc); |
38 |
> |
error(SYSTEM, errmsg); |
39 |
> |
} |
40 |
> |
} |
41 |
|
|
42 |
< |
nalloc++; |
43 |
< |
return(p); |
42 |
> |
nalloc++; |
43 |
> |
return(p); |
44 |
|
} |
45 |
|
|
46 |
|
|