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) {
125
125
supervisor_allocation * alloc ;
126
126
for (; index < CIRCUITPY_SUPERVISOR_ALLOC_COUNT ; index += direction ) {
127
127
alloc = & allocations [index ];
128
- if (alloc -> length == FREE ) {
128
+ if (alloc -> length == FREE && ( high_address - low_address ) * 4 >= ( int32_t ) length ) {
129
129
break ;
130
130
}
131
131
// If a hole matches in length exactly, we can reuse it.
@@ -134,7 +134,7 @@ supervisor_allocation* allocate_memory(uint32_t length, bool high) {
134
134
return alloc ;
135
135
}
136
136
}
137
- if (index >= CIRCUITPY_SUPERVISOR_ALLOC_COUNT || ( high_address - low_address ) * 4 < ( int32_t ) length ) {
137
+ if (index >= CIRCUITPY_SUPERVISOR_ALLOC_COUNT ) {
138
138
return NULL ;
139
139
}
140
140
if (high ) {
You can’t perform that action at this time.
0 commit comments