Skip to content

Commit 25b7140

Browse files
committed
Fix goal compare condition, format tweaks.
1 parent c80ac37 commit 25b7140

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

InternalDocs/qsbr.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ mechanism to determine when it is safe to free the list's old backing array.
3939

4040
Specific use cases for QSBR include:
4141

42-
* Dictionary keys (PyDictKeysObject) and list arrays (_PyListArray): When a
42+
* Dictionary keys (PyDictKeysObject) and list arrays (`_PyListArray`): When a
4343
dictionary or list that may be shared between threads is resized, we use QSBR
4444
to delay freeing the old keys or array until it's safe. For dicts and lists
4545
that are not shared, their storage can be freed immediately upon resize.
4646

47-
* Mimalloc mi_page_t: Non-locking dictionary and list accesses require
47+
* Mimalloc `mi_page_t`: Non-locking dictionary and list accesses require
4848
cooperation from the memory allocator. If an object is freed and its memory is
4949
reused, we must ensure the new object's reference count field is at the same
50-
memory location. In practice, this means when a mimalloc page (mi_page_t)
50+
memory location. In practice, this means when a mimalloc page (`mi_page_t`)
5151
becomes empty, we don't immediately allow it to be reused for allocations of a
5252
different size class. QSBR is used to determine when it's safe to repurpose the
5353
page or return its memory to the OS.
@@ -91,9 +91,9 @@ Periodically, a polling mechanism processes this deferred-free list:
9191
1. The minimum read sequence value across all active threads is calculated and
9292
stored as the global `rd_seq`.
9393

94-
2. For each item on the deferred-free list, if its qsbr_goal is less than the
95-
new `rd_seq`, its memory is freed, and it is removed from the list. Otherwise,
96-
it remains on the list for a future attempt.
94+
2. For each item on the deferred-free list, if its qsbr_goal is less than or
95+
equal to the new `rd_seq`, its memory is freed, and it is removed from the
96+
list. Otherwise, it remains on the list for a future attempt.
9797

9898

9999
### Deferred Advance Optimization

0 commit comments

Comments
 (0)