Projet_SETI_RISC-V/riscv-gnu-toolchain/newlib/libgloss/m68k/fido-sbrk.c
2023-03-06 14:48:14 +01:00

15 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;
}