Panic in sbrk if setheap hasn't been called yet. This is preferable to
a mysterious crash. Sponsored by: Netflix
This commit is contained in:
parent
cbd72f6554
commit
f67f1d6d70
@ -52,6 +52,9 @@ sbrk(int incr)
|
||||
{
|
||||
char *ret;
|
||||
|
||||
if (heapbase == 0)
|
||||
panic("No heap setup\n");
|
||||
|
||||
if ((heapsize + incr) <= maxheap) {
|
||||
ret = (char *)heapbase + heapsize;
|
||||
bzero(ret, incr);
|
||||
|
Loading…
Reference in New Issue
Block a user