Skip to content

Commit a47d6d6

Browse files
authored
Allow heap end to be equal to stack limit (#266)
1 parent 1d4588a commit a47d6d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rp2_common/pico_runtime/runtime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ void *_sbrk(int incr) {
175175
prev_heap_end = heap_end;
176176
char *next_heap_end = heap_end + incr;
177177

178-
if (__builtin_expect(next_heap_end >= (&__StackLimit), false)) {
178+
if (__builtin_expect(next_heap_end > (&__StackLimit), false)) {
179179
#if PICO_USE_OPTIMISTIC_SBRK
180-
if (next_heap_end == &__StackLimit) {
180+
if (heap_end == &__StackLimit) {
181181
// errno = ENOMEM;
182182
return (char *) -1;
183183
}

0 commit comments

Comments
 (0)