Commit 3c83df2
committed
Now that we're no longer linking arenas together, there's no need to
waste the first pool if malloc happens to return a pool-aligned address.
This means the number of pools per arena can now vary by 1. Unfortunately,
the code counted up from 0 to a presumed constant number of pools. So
changed the increasing "watermark" counter to a decreasing "nfreepools"
counter instead, and fiddled various stuff accordingly. This also allowed
getting rid of two more macros.
Also changed the code to align the first address to a pool boundary
instead of a page boundary. These are two parallel sets of macro #defines
that happen to be identical now, but the page macros are in theory more
restrictive (bigger), and there's simply no reason I can see that it
wasn't aligning to the less restrictive pool size all along (the code
only relies on pool alignment).
Hmm. The "page size" macros aren't used for anything *except* defining
the pool size macros, and the comments claim the latter isn't necessary.
So this has the feel of a layer of indirection that doesn't serve a
purpose; should probably get rid of the page macros now.1 parent 1230068 commit 3c83df2
1 file changed
Lines changed: 21 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
| 166 | + | |
172 | 167 | | |
173 | 168 | | |
174 | 169 | | |
| |||
180 | 175 | | |
181 | 176 | | |
182 | 177 | | |
183 | | - | |
184 | 178 | | |
185 | 179 | | |
186 | 180 | | |
| |||
324 | 318 | | |
325 | 319 | | |
326 | 320 | | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
| 321 | + | |
| 322 | + | |
332 | 323 | | |
333 | | - | |
| 324 | + | |
334 | 325 | | |
335 | 326 | | |
336 | 327 | | |
| |||
360 | 351 | | |
361 | 352 | | |
362 | 353 | | |
363 | | - | |
| 354 | + | |
| 355 | + | |
364 | 356 | | |
365 | 357 | | |
366 | 358 | | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
371 | 368 | | |
372 | 369 | | |
373 | 370 | | |
| |||
437 | 434 | | |
438 | 435 | | |
439 | 436 | | |
440 | | - | |
| 437 | + | |
441 | 438 | | |
442 | | - | |
| 439 | + | |
443 | 440 | | |
444 | 441 | | |
445 | 442 | | |
446 | | - | |
| 443 | + | |
447 | 444 | | |
448 | 445 | | |
449 | 446 | | |
| |||
558 | 555 | | |
559 | 556 | | |
560 | 557 | | |
561 | | - | |
562 | | - | |
| 558 | + | |
563 | 559 | | |
564 | | - | |
565 | | - | |
| 560 | + | |
| 561 | + | |
566 | 562 | | |
567 | 563 | | |
568 | 564 | | |
| |||
0 commit comments