/************************************************************* * File: imon/sbrk.c * Purpose: Part of the Ice Monitor * Author: Phil Bunce (pjb@carmel.com) * Revision History: * 970304 Start of revision history */ #include extern char BSS_END; char *allocp1 = &BSS_END; char *sbrk(n) int n; { char *heaptop,*t; t = getMonEnv("heaptop"); if (t == 0) heaptop = (char *)CLIENTPC; else { if (!atob((unsigned int *)&heaptop,t,16)) { heaptop = (char *)CLIENTPC; } } if (allocp1 + n <= heaptop) { allocp1 += n; return(allocp1 - n); } else return(0); }