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
328884aef7
commit
9a7c084993
@ -52,6 +52,9 @@ sbrk(int incr)
|
|||||||
{
|
{
|
||||||
char *ret;
|
char *ret;
|
||||||
|
|
||||||
|
if (heapbase == 0)
|
||||||
|
panic("No heap setup\n");
|
||||||
|
|
||||||
if ((heapsize + incr) <= maxheap) {
|
if ((heapsize + incr) <= maxheap) {
|
||||||
ret = (char *)heapbase + heapsize;
|
ret = (char *)heapbase + heapsize;
|
||||||
bzero(ret, incr);
|
bzero(ret, incr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user