Commit 10b458b
committed
Fix fragile page count test to handle page reuse
The test_page_count_increases_with_allocation test assumed that
allocating objects would always create new pages. However, mimalloc
reuses pages from its freelist, so when run after other tests that
freed pages, the page count may not increase.
Changed the assertion from assertGreater to assertGreaterEqual to
verify the key invariant: page count doesn't decrease while objects
are alive. Added comment explaining the page reuse behaviour.1 parent c4c192c commit 10b458b
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
| |||
0 commit comments