mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-12-10 07:14:36 +01:00
Allow heap end to be equal to stack limit (#266)
This commit is contained in:
parent
1d4588a565
commit
a47d6d6e14
1 changed files with 2 additions and 2 deletions
|
|
@ -175,9 +175,9 @@ void *_sbrk(int incr) {
|
|||
prev_heap_end = heap_end;
|
||||
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 (next_heap_end == &__StackLimit) {
|
||||
if (heap_end == &__StackLimit) {
|
||||
// errno = ENOMEM;
|
||||
return (char *) -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue