lua-users home
lua-l archive

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


> The main issue that jumps out at me regarding the "run a garbage  
> collection cycle" approach is that if you have any complicated error  
> handling, it could result in multiple GC cycles which it might be nice  
> to avoid.

By "complicated error handling" you mean error handling that raises
errors again? I guess the most common use of these structures is to
release resources: you catch the error only to release something, and
then rethrows it up. If release is automatic, you seldom would need
this kind of code.

And again, you only pay the penalty if there is an actual error.
Exceptions are to be exceptional. Unfortunately, I do not think we can
optimize this. (We would need to do a full colection only in the last
error, not the first. How to know whether more will come?)

-- Roberto