[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Lua 5.3.2 (rc1) now available
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 23 Nov 2015 11:31:31 -0200
> On 19-Nov-15 05:49, Daurnimator wrote:
> >>>Why does ltablib.c now `#include <time.h>`
> >>>Because `clock()` and `time()` are used to find a pivot element for sorting.
> >Ah, somehow I missed that. This seems a poor choice....
> >Could this be made configurable via moving to llimits.h?
> Those calls could be a nuisance in embedded applications.
> Perhaps replacing them with GET_PIVOT_SEED1(), GET_PIVOT_SEED2()
> macros, or just a CHOOSE_PIVOT(lo, up) macro in luaconf.h?
We have added a macro 'l_sortpivot' to simplify changing that code, but
what do you mean by "nuisance" in embedded applications? These functions
are ANSI C89, and a library can trivially implement them by returning -1.
(For both of them this is a valid implementation). If by "nuisance" you
mean expensive, we only call it for partitions larger than 100, so
it seems their cost is quite diluted in the sort work.