lua-users home
lua-l archive

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


debug.sethook will let you count the number of line executions.
 
Of course, perfect infinite loop detection is, in fact, impossible (http://en.wikipedia.org/wiki/Halting_problem). Ask Garry how he's doing it (probably by a C hook).

Sent: Saturday, October 10, 2009 P5:33
Newsgroups: gmane.comp.lang.lua.general
Subject: Infinite Loop Detection

I've seen infinite loop detection used in applications before. (Garry's Mod)

Does anyone know how to go about creating something like this. It doesn't have to necessarily check for an infinite as much as hit a threshold limit for how many time a loop can repeat itself.

Any Ideas? Thanks