mirror of
https://github.com/arabine/open-story-teller.git
synced 2025-12-07 09:19:57 +01:00
16 lines
296 B
C
Executable file
16 lines
296 B
C
Executable file
/* 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;
|
|
} |