Commit 98e1688
committed
Auto merge of #78058 - bugadani:arena2, r=lcnr
Make sure arenas don't allocate bigger than HUGE_PAGE
Right now, arenas allocate based on the size of the last chunk. It is possible for a `grow` call to allocate a chunk that is not a multiple of `PAGE`, and this size is doubled for each subsequent allocation. This means, instead of `HUGE_PAGE`, the biggest page possible is actually unknown.
This change fixes this, and also removes an unnecessary checked multiplication. It is still possible to allocate bigger than `HUGE_PAGE` pages, but this will only happen as many times as absolutely necessary.1 file changed
+4
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
| 226 | + | |
| 227 | + | |
230 | 228 | | |
231 | 229 | | |
232 | 230 | | |
| |||
343 | 341 | | |
344 | 342 | | |
345 | 343 | | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
| 344 | + | |
| 345 | + | |
350 | 346 | | |
351 | 347 | | |
352 | 348 | | |
| |||
0 commit comments