2014-03-27 13:05 GMT+02:00 Mike Pall <mike-1403@xxxxxxxxxx>: > I wonder whether your problems couldn't be solved better by > working around these issues in your code. E.g. using branch-free > idioms, manually unrolling loops with a low iteration count or > on-the-fly code generation from templates. Yes. I see what you mean. That said I can't go that way. The idea of implementing this specific number crunching algorithms was in creating a really small amount of core APL-like vector functions/operations (plus something similar to multiple dispatch in CL) and implementing some other performance critical code in traditional C-like style. A smallish APL-like core is necessary for building quick prototypes and only if some optimization is required I go back C-style route. That idea worked really well so far. LuaJIT did wonders in unrolling deeply nested "generic" functions and building specific C-style code in small tight loops. >> jit.opt.start("-abc") -- without this one if happens really often > > Well, FFI accesses are not bounds-checked, anyway. So disabling > ABC elimination does nothing for those loops. The problem must be > somewhere else. That makes sense, of course. Looks like I need to retest my assumptions again. > That said: out-of-bounds FFI write accesses and unanchored FFI > cdata objects are very common causes for intermittent crashes and > various strange symptoms. You should double-check the code for > that. If the problems cease when you use collectgarbage("stop") > then you most certainly have an unanchored FFI cdata object. Hm. Could you confirm that by "unanchored FFI cdata" you mean native arrays which are deallocated randomly by non-Lua part? BR, Denis