#include "ll.h"
void*
mysbrk(usize size)
{
return sbrk(size);
}
void
gethunk(void)
{
char *h;
long nh;
nh = NHUNK;
if(thunk >= 5L*NHUNK) {
nh = 5L*NHUNK;
if(thunk >= 25L*NHUNK)
nh = 25L*NHUNK;
}
h = mysbrk(nh);
if(h == (char*)-1) {
diag("out of memory");
errorexit();
}
hunk = h;
nhunk = nh;
thunk += nh;
}
|