mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-27 07:31:35 +00:00
16 lines
275 B
C
16 lines
275 B
C
#include <stddef.h>
|
|
|
|
extern char _end[];
|
|
static char *curbrk = _end;
|
|
extern char _heapend; /* End of heap */
|
|
|
|
void *
|
|
sbrk (ptrdiff_t incr)
|
|
{
|
|
char *oldbrk = curbrk;
|
|
if (curbrk + incr > &_heapend)
|
|
return (void *) -1;
|
|
curbrk += incr;
|
|
return oldbrk;
|
|
}
|