[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Please help with GC internals
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 9 Dec 2013 09:46:38 -0200
> I want to add a flag (lets name it 'keepAlive') to gc-managed Lua values
> (tables, closures, strings) that will prevent garbage collection of this
> values even if there are no strong references to them
Just turn on the FIXEDBIT in the marked field.
For strings there is a macro:
lstring.h:#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)