lua-users home
lua-l archive

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


On Friday 09 September 2005 01:04, Mike Pall wrote:
[...]
> Sure. But only when memory that has once been executed
> is _reused_ for other code. Which doesn't happen too often
> with a JIT compiler. Most apps usually converge quickly to
> a stable set -- and I'm not doing dynamic recompilation (yet).

The phrase "doesn't happen too often" is one of those things that makes all my 
developer spider-senses tingle, I'm afraid, because if you don't get this 
right you end up with weird, difficult to reproduce, impossible to debug bugs 
--- we dealt with this the hard way for intent.

Typically the situation is:

* Translate big function.
* Execute function.
* Free function.
* Translate small function (which happens to get placed in the same block of 
memory as the big function).
* Execute small function.
* Aaaaah!

This won't happen often, and is likely to manifest as rare, random crashes for 
no apparent reason. Your customers will complain, you'll try and fail to 
investigate (because your debug systems are laid out differently and the bug 
won't trigger), and eventually you'll feel a nervous breakdown on the horizon 
before you figure out what's actually going on... it's definitely worth going 
to some extra effort to make sure it's done *right* to begin with. Saves a 
lot of grief later.

-- 
+- David Given --McQ-+ "For is it not written, wheresoever two or three
|  dg@cowlark.com    | are gathered together, yea they will perform the
| (dg@tao-group.com) | Parrot Sketch?" --- _Not The 9 o'Clock News_
+- www.cowlark.com --+ 

Attachment: pgpkURPG327Xa.pgp
Description: PGP signature