lua-users home
lua-l archive

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



The hook approach could be used for memory usage limiting, too? Or maybe it would be the All Best approach to provide each state with their own alloc/free routines (Lua does make it easy). In such case, the allocation could have a per-state limit, and if a state is killed (since it's a Bad Boy) also all allocated blocks could be released (since the allocator knows which they are).

A little extra trouble, but I'd see it useful - anyone done such?

-asko


Nick Gammon kirjoitti 14.10.2006 kello 9.19:


If you can parse a script in about 1/27000 of a second, I can't really think why you would want to do that. The execution part can be stopped by placing "hook" functions, which are tested on each VM instruction cycle. If you thought a script execution might go into an endless loop, then such a hook function could well be desirable.

- Nick