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:
Warner Losh 2017-12-15 23:16:47 +00:00
parent 328884aef7
commit 9a7c084993
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=326886

View File

@ -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);