[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Extending array types in Ravi
- From: Dibyendu Majumdar <mobile@...>
- Date: Mon, 9 Nov 2015 12:51:36 +0000
On 9 November 2015 at 11:06, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>> The constants that represent keys for a table in expressions like:
>>
>> t.name
>>
>> can the compiler assume that the pointer to 'name' string will never
>> change - i.e. can the JIT compiler treat the pointer as an integer
>> (intptr_t) literal?
>
> Sure (as long the string is not collected...)
>
But as long as the function lives, any strings in the constant table
cannot be collected; the JIT code gets collected at the same time as
the function, so after the function is collected we don't care about
the string anymore.
I suppose if the JIT code were to be saved and reused then it could be problem.
Regards