2003-04-24 14:36:08 +02:00
|
|
|
/* Version of sbrk for no operating system. */
|
2000-03-17 23:48:54 +01:00
|
|
|
|
2004-05-26 22:38:51 +02:00
|
|
|
#include "config.h"
|
2004-05-26 22:32:58 +02:00
|
|
|
#include <_syslist.h>
|
|
|
|
|
2003-04-24 14:36:08 +02:00
|
|
|
void *
|
|
|
|
_sbrk (incr)
|
|
|
|
int incr;
|
2000-03-17 23:48:54 +01:00
|
|
|
{
|
2003-04-24 14:36:08 +02:00
|
|
|
extern char end; /* Set by linker. */
|
|
|
|
static char * heap_end;
|
|
|
|
char * prev_heap_end;
|
|
|
|
|
|
|
|
if (heap_end == 0)
|
|
|
|
heap_end = & end;
|
2000-03-17 23:48:54 +01:00
|
|
|
|
|
|
|
prev_heap_end = heap_end;
|
|
|
|
heap_end += incr;
|
2003-04-24 14:36:08 +02:00
|
|
|
|
|
|
|
return (void *) prev_heap_end;
|
2000-03-17 23:48:54 +01:00
|
|
|
}
|