lua-users home
lua-l archive

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


Philipp Janda <siffiejoe@gmx.net> writes:
>>> Mmapped files are a problem though (unless you don't use them in table
>>> keys), because the contents could change at any moment.
>>
>> It's up to the application-writer who hands the memory to Lua to worry
>> about this, though.
>
> The application writer can worry all he wants, but he can do nothing
> about it. The application user has to make sure that no one writes to
> that file while the Lua application uses it.

[... but he doesn't need to do it by technical means...]

Anyway, the important point is that if Lua offers an interface that
explicitly keeps a reference to "external" memory, it doesn't know
where the memory it's given comes from, and doesn't need to, as long
as the caller abides by the requirements of the interface, or is
prepared to deal with the results of not doing so.

Callers that want Lua to make a copy so they don't need to worry about
such things can call the old interface.

-Miles

-- 
"Yorton, Wressle, and Gospel Oak, the richness of your heritage is ended.
We shall not stop at you again; for Dr Beeching stops at nothing."