Skip to content

Commit

Permalink
Use __heap_start in picosbrk instead of __end
Browse files Browse the repository at this point in the history
This lets applications place the heap anywhere they like in
memory, instead of insisting that it follow bss.

Signed-off-by: Keith Packard <[email protected]>
  • Loading branch information
keith-packard committed Apr 22, 2020
1 parent 80c81ff commit 79ccb2c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions newlib/libc/picolib/picosbrk.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,10 @@

#include <unistd.h>

extern char __end[];
extern char __heap_start[];
extern char __heap_end[];
extern char __heap_size[];

static char *brk = __end;

#define heap_size ((uintptr_t)__heap_size)
static char *brk = __heap_start;

void *sbrk(ptrdiff_t incr)
{
Expand Down

0 comments on commit 79ccb2c

Please sign in to comment.