Re: Does anyone happen to have a good pure Lua/FFI qsort for int tuples?

  • From: Konstantin Olkhovskiy <lupus@xxxxxxxxxx>
  • To: luajit <luajit@xxxxxxxxxxxxx>
  • Date: Tue, 21 Jul 2015 13:03:31 +0300

So I was wondering if anyone might have a good implementation
they would be willing to share? For my purposes I just care about
sorting an array of structs

We've successfuly used DynAsm to create custom comparators that are fed to
LMDB.

We pass generator a simple pattern string ala printf format, and it
produces a qsort compatible cmp function. Exact code for each type was just
borrowed from gcc assembly.

Although an overkill for your case, it might be useful for someone.

Other related posts: