[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: gc and strings
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 26 Sep 2000 18:47:41 -0300 (EST)
>a) Is there a place in the lua C code that I can stick
> a breakpoint to watch/trace the garbage collection?
lua_collectgarbage :-)
Just curious: why would you want to do this?
>b) Does the Lua compiler (i.e. dofile() or luac) combine
> duplicate strings? I have a lua file that is rather
> large but duplicates some strings 20-30 times.
Yes, the parser does that.
You can see that it does if you run luac -l and then check that identical
strings have the same index (= operand to PUSHSTRING).
Or if you look at an hex dump of the output of luac (luac.out, by default).
All strings should be in the same section of the file, separated by 5 bytes
of "junk" (= their lenght plus a terminating 0).
--lhf