]> git.eshelyaron.com Git - emacs.git/commit
* src/alloc.c: Avoid O(N²) complexity when unchaining markers (bug#24548).
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 23 Mar 2018 15:09:54 +0000 (11:09 -0400)
committerAndrew G Cohen <cohen@andy.bu.edu>
Tue, 11 Dec 2018 06:17:58 +0000 (14:17 +0800)
commit7985c8786732ed90bba75f74b924384686f1afdc
treeaf0377f27a4ac603b58094a320e3fc8ec3924a1a
parent992a8ecc09bf2147b62618c6b6005eb83457845e
* src/alloc.c: Avoid O(N²) complexity when unchaining markers (bug#24548).

Unchain all dead markers with a single scan of the markers list,
instead of calling the O(N) 'unchain_marker' N times.

(unchain_dead_markers): New function.
(sweep_buffers): Use it.
(gc_sweep): Sweep buffers before markers.
(sweep_misc): Check that markers have been unchained when reclaiming them.
src/alloc.c