summaryrefslogtreecommitdiffstats
path: root/include/jemalloc/internal/ph.h
Commit message (Collapse)AuthorAgeFilesLines
* Add any() and remove_any() to ph.Jason Evans2017-03-071-4/+54
| | | | | | | These functions select the easiest-to-remove element in the heap, which is either the most recently inserted aux list element or the root. If no calls are made to first() or remove_first(), the behavior (and time complexity) is the same as for a LIFO queue.
* Replace tabs following #define with spaces.Jason Evans2017-01-211-16/+16
| | | | This resolves #564.
* Remove extraneous parens around return arguments.Jason Evans2017-01-211-4/+4
| | | | This resolves #540.
* Update brace style.Jason Evans2017-01-211-25/+25
| | | | | | | Add braces around single-line blocks, and remove line breaks before function-opening braces. This resolves #537.
* Remove leading blank lines from function bodies.Jason Evans2017-01-131-4/+0
| | | | This resolves #535.
* Fix a style nit.Jason Evans2016-04-131-1/+2
|
* Refactor/fix ph.Jason Evans2016-04-111-236/+320
| | | | | | | | | | | | | | | | | | | | | Refactor ph to support configurable comparison functions. Use a cpp macro code generation form equivalent to the rb macros so that pairing heaps can be used for both run heaps and chunk heaps. Remove per node parent pointers, and instead use leftmost siblings' prev pointers to track parents. Fix multi-pass sibling merging to iterate over intermediate results using a FIFO, rather than a LIFO. Use this fixed sibling merging implementation for both merge phases of the auxiliary twopass algorithm (first merging the aux list, then replacing the root with its merged children). This fixes both degenerate merge behavior and the potential for deep recursion. This regression was introduced by 6bafa6678fc36483e638f1c3a0a9bf79fb89bfc9 (Pairing heap). This resolves #371.
* Refactor ph_merge_ordered() out of ph_merge().Jason Evans2016-03-081-17/+22
|
* Pairing heapDave Watson2016-03-081-0/+255
Initial implementation of a twopass pairing heap with aux list. Research papers linked in comments. Where search/nsearch/last aren't needed, this gives much faster first(), delete(), and insert(). Insert is O(1), and first/delete don't have to walk the whole tree. Also tested rb_old with parent pointers - it was better than the current rb.h for memory loads, but still much worse than a pairing heap. An array-based heap would be much faster if everything fits in memory, but on a cold cache it has many more memory loads for most operations.