lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Didnt manage to crash it, looked through the source code, and looks
like an ok patch to me.

I suppose TM_COUNT is on purpose in the "fast" area of TMS?

One can argue the biggest downside is the increased memory use of
<struct Table> by 4 bytes. And the +-1 counting while running. Might
instead add numusearray() + numusehash() when requesting %count? Or if
kept the existing count could be used to optimize speed in rehash(). I
suppose this the typical case of deciding between memory use vs. CPU
use optimizations.

BTW: The last days I've myself been studying the code around ltable.c
and if I could fit in a "all integer keys are sure a linear list" flag
(e.g. missuse bit 8 of marked? I don't see/grep any luaL_checkmemory
anyway) and what it would mean for performance. Where the flag not
set, would not guarantee it has not become a linear list by e.g.
filling the spaces, unless a linear traversal check. I'll let you all
know, if i get anything working.

On Wed, Jan 5, 2011 at 9:53 AM, Henning Diedrich <hd2010@eonblast.com> wrote:
> Hi Axel,
>
> I implented 'true length', if you care to take a look and try to crash it
>
> https://github.com/Eonblast/Lua
>
> test/len.lua und test/strlen.lua are the files to test
>
> Henning