Allow heap end to be equal to stack limit (#266)
This commit is contained in:
parent
1d4588a565
commit
a47d6d6e14
@ -175,9 +175,9 @@ void *_sbrk(int incr) {
|
|||||||
prev_heap_end = heap_end;
|
prev_heap_end = heap_end;
|
||||||
char *next_heap_end = heap_end + incr;
|
char *next_heap_end = heap_end + incr;
|
||||||
|
|
||||||
if (__builtin_expect(next_heap_end >= (&__StackLimit), false)) {
|
if (__builtin_expect(next_heap_end > (&__StackLimit), false)) {
|
||||||
#if PICO_USE_OPTIMISTIC_SBRK
|
#if PICO_USE_OPTIMISTIC_SBRK
|
||||||
if (next_heap_end == &__StackLimit) {
|
if (heap_end == &__StackLimit) {
|
||||||
// errno = ENOMEM;
|
// errno = ENOMEM;
|
||||||
return (char *) -1;
|
return (char *) -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user