Uploaded image for project: 'Lucy'
  1. Lucy
  2. LUCY-99

Merge sort elements of arbitrary width

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Util
    • Labels:
      None

      Description

      The present implementation of mergesort in SortUtils only handles four-byte and
      eight-byte elements, because it was intended only for sorting pointers, but it
      would be convenient to make it possible to sort elements of arbitrary width.

      We can add a width argument without sacrificing speed by taking advantage of
      the fact that optimizing compilers such as GCC produce identical assembler for
      invocations of memcpy() where the amount to copy is a small constant known
      at compile time as for direct assigment.

        Attachments

        1. mergesort_any_width.diff
          9 kB
          Marvin Humphrey

          Activity

            People

            • Assignee:
              marvin Marvin Humphrey
              Reporter:
              marvin Marvin Humphrey
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: