lua-users home
lua-l archive

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


I have a few questions about subj:

1) Can GC happen during parsing (in stock lua)? (tests & glances at lparser.c say `no', but I'm still not sure)
2) Is the parser GC-safe?
3) Imagine now that somewhere in my modified parser I want to read a sequence of identifiers separated by dots:

tn ::= name`.'name`.'name`.'name

And I'm using the following code (just an example):[0] = str_checkname(ls);[1] = str_checkname(ls);[2] = str_checkname(ls);[3] = str_checkname(ls);

And GC can occur somewhere in dosmthwithtn...

What is the best way in this case to protect from being touched by collector? (currently I'm thinking about doing l_setbit((s)->tsv.marked, FIXEDBIT) before and resetbit((s)->tsv.marked, FIXEDBIT) after dosmthwithtn. But I'm not sure whether this is the correct solution or not...)

Antero Vipunen.

A language that doesn't affect the way you think about programming, is not worth knowing -- Alan Perlis