ac7d9e0...
by
Andrew G Cohen <email address hidden>
; Fix typo
* test/src/fns-tests.el (fns-tests-sort): Compare with independently
sorted list.
186ec2f...
by
Andrew G Cohen <email address hidden>
Add another sorting unit test
* test/src/fns-tests.el (fns-tests-sort): Check for corruption should
garbage-collection occur during sorting.
43a339f...
by
=?utf-8?q?Mattias_Engdeg=C3=A5rd?= <email address hidden>
Fix over-zealous assertions
* src/sort.c (gallop_left, gallop_right): Don't test Lisp values for
being nonzero; it only made sense when `key` was a pointer that had to
be non-null.
63c1f0d...
by
=?utf-8?q?Mattias_Engdeg=C3=A5rd?= <email address hidden>
; Fix mistake in last commit (use of wrong variable)
72a313d...
by
=?utf-8?q?Mattias_Engdeg=C3=A5rd?= <email address hidden>
Resolve sort predicate ahead of time
* src/sort.c (tim_sort): If the sort predicate is a symbol, find the
corresponding function before starting the sort. This is especially
beneficial if the predicate was an alias (`string<`, for example).
8ef42e0...
by
Andrew G Cohen <email address hidden>
Add more sorting unit tests
* test/src/fns-tests.el (fns-tests-sort): New sorting unit tests.
9edfa27...
by
Andrew G Cohen <email address hidden>
; Minor improvements to timsort
* src/fns.c (sort_list, sort_vector): Improve documentation and
variable names.
(merge): Replace function inorder with direct use of call2.
* src/lisp.h: Remove inorder prototype.
* src/sort.c:
(struct reloc): Document the order field.
(inorder): Uppercase INLINE.
(binarysort): Move type declaration.
(needmem): New INLINE function.
(merge_lo, merge_hi): Use it.
(merge_getmem): Remove unnecessary if.
(tim_sort): Remove unnecessary if.
(reverse_vector): Shift instead of integer divide by 2.
e0470bc...
by
Andrew G Cohen <email address hidden>
Replace list and vector sorting with TIMSORT algorithm
* src/Makefile.in (base_obj): Add sort.o.
* src/deps.mk (fns.o): Add sort.c.
* src/lisp.h: Add prototypes for inorder, tim_sort.
* src/sort.c: New file providing tim_sort.
* src/fns.c: Remove prototypes for removed routines.
(merge_vectors, sort_vector_inplace, sort_vector_copy): Remove.
(sort_list, sort_vector): Use tim_sort.
daf4670...
by
=?utf-8?q?Mattias_Engdeg=C3=A5rd?= <email address hidden>
Add optional GC marking function to specpdl unwind_ptr record
Add a new `record_unwind_protect_ptr_mark` function for use with C data
structures that use the specpdl for clean-up but also contain possibly
unique references to Lisp objects.
* src/eval.c (record_unwind_protect_ptr_mark): New.
(record_unwind_protect_module, set_unwind_protect_ptr):
Set the mark function to NULL.
(mark_specpdl): Call the mark function if present.
* src/lisp.h (unwind_ptr): Add a mark function pointer to the
SPECPDL_UNWIND_PTR case.