Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
10ee4fd
Add section about the design of CPython's garbage collector
pablogsal Jan 20, 2020
8aac485
Fix several typos
pablogsal Jan 20, 2020
7776e14
Update garbage_collector.rst
pablogsal Jan 20, 2020
c72ce11
Fix more typos
pablogsal Jan 20, 2020
410487b
Update garbage_collector.rst
pablogsal Jan 20, 2020
b18da79
Update garbage_collector.rst
pablogsal Jan 20, 2020
25d7555
Apply suggestions from code review
pablogsal Jan 20, 2020
811235f
Fix more typos
pablogsal Jan 20, 2020
8b72c71
Update garbage_collector.rst
pablogsal Jan 20, 2020
3b84282
Update garbage_collector.rst
pablogsal Jan 20, 2020
0d3f322
Apply suggestions from code review
pablogsal Jan 21, 2020
d84a267
Apply suggestions from code review
pablogsal Jan 21, 2020
5ca46f7
Fix indentation and rework incomplete sentence
pablogsal Jan 21, 2020
404fcc5
Fix more indentation
pablogsal Jan 21, 2020
8fc0547
Rework sentence about _gc_prev
pablogsal Jan 21, 2020
e956478
Update garbage_collector.rst
pablogsal Jan 21, 2020
47190cd
Fix indentation
pablogsal Jan 21, 2020
722a99c
Fix quotes
pablogsal Jan 21, 2020
b40b030
Fix typo and indentation
pablogsal Jan 21, 2020
111b2bb
Update garbage_collector.rst
pablogsal Jan 21, 2020
2ec5002
Update garbage_collector.rst
pablogsal Jan 21, 2020
7c8e02a
Add author section
pablogsal Jan 21, 2020
e51d354
Add a warning section regarding tagged pointers
pablogsal Jan 21, 2020
411037f
Add reference to the memory layout
pablogsal Jan 21, 2020
4081607
Fix link to the generation section
pablogsal Jan 21, 2020
03178a0
Apply suggestions from code review
pablogsal Jan 21, 2020
6d01e46
Fix more typos
pablogsal Jan 21, 2020
4321593
Address Petr feedback and fix more typos
pablogsal Jan 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix indentation
  • Loading branch information
pablogsal committed Jan 21, 2020
commit 47190cd8c09e4a2749f95c67624da9288dfe1505
10 changes: 7 additions & 3 deletions garbage_collector.rst
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,14 @@ The CPython GC makes use of two fat pointers:
used for storing the temporary copy of the reference count (``gc_refs``), and the
Comment thread
pablogsal marked this conversation as resolved.
Outdated
GC linked list becomes a singly linked list until ``_gc_prev`` is restored.

* The ``_gc_next`` field is used as the "next" pointer to maintain the doubly
linked list but during collection its lowest bit is used to keep the
* The ``_gc_next`` field is used as the "next" pointer to maintain the doubly linked
list but during collection its lowest bit is used to keep the
``NEXT_MASK_UNREACHABLE`` flag that indicates if an object is tentatively
unreachable during the cycle detection algorithm. This is a drawback to using only doubly linked lists to implement partitions: while most needed operations are constant-time, there is no efficient way to determine which partition an object is currently in. Instead, when that's needed, ad hoc tricks (like the ``NEXT_MASK_UNREACHABLE`` flag) are employed.
unreachable during the cycle detection algorithm. This is a drawback to using only
doubly linked lists to implement partitions: while most needed operations are
constant-time, there is no efficient way to determine which partition an object is
currently in. Instead, when that's needed, ad hoc tricks (like the
``NEXT_MASK_UNREACHABLE`` flag) are employed.

Optimization: delay tracking containers
---------------------------------------
Expand Down