You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
/* See LICENSE of license details. */
|
|
|
|
#include <stddef.h>
|
|
|
|
void *_sbrk(ptrdiff_t incr)
|
|
{
|
|
extern char _end[];
|
|
extern char _heap_end[];
|
|
static char *curbrk = _end;
|
|
|
|
if ((curbrk + incr < _end) || (curbrk + incr > _heap_end))
|
|
return NULL - 1;
|
|
|
|
curbrk += incr;
|
|
return curbrk - incr;
|
|
} |