@@ -39,15 +39,15 @@ mechanism to determine when it is safe to free the list's old backing array.
3939
4040Specific 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
4343dictionary or list that may be shared between threads is resized, we use QSBR
4444to delay freeing the old keys or array until it's safe. For dicts and lists
4545that 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
4848cooperation from the memory allocator. If an object is freed and its memory is
4949reused, 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 ` )
5151becomes empty, we don't immediately allow it to be reused for allocations of a
5252different size class. QSBR is used to determine when it's safe to repurpose the
5353page or return its memory to the OS.
@@ -91,9 +91,9 @@ Periodically, a polling mechanism processes this deferred-free list:
91911 . 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