File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ supervisor_allocation* allocate_memory(uint32_t length, bool high) {
125125 supervisor_allocation * alloc ;
126126 for (; index < CIRCUITPY_SUPERVISOR_ALLOC_COUNT ; index += direction ) {
127127 alloc = & allocations [index ];
128- if (alloc -> length == FREE ) {
128+ if (alloc -> length == FREE && ( high_address - low_address ) * 4 >= ( int32_t ) length ) {
129129 break ;
130130 }
131131 // If a hole matches in length exactly, we can reuse it.
@@ -134,7 +134,7 @@ supervisor_allocation* allocate_memory(uint32_t length, bool high) {
134134 return alloc ;
135135 }
136136 }
137- if (index >= CIRCUITPY_SUPERVISOR_ALLOC_COUNT || ( high_address - low_address ) * 4 < ( int32_t ) length ) {
137+ if (index >= CIRCUITPY_SUPERVISOR_ALLOC_COUNT ) {
138138 return NULL ;
139139 }
140140 if (high ) {
You can’t perform that action at this time.
0 commit comments