[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Registry and references
- From: Thomas Lauer <thomas.lauer@...>
- Date: Mon, 25 Jun 2007 10:39:05 +0100
Quoted from section "3.5 - Registry" of you-know-what:-)
"Any C library can store data into this table, but it should take care
to choose keys different from those used by other libraries, to avoid
collisions. Typically, you should use as key a string containing your
library name or a light userdata with the address of a C object in your
The integer keys in the registry are used by the reference mechanism,
implemented by the auxiliary library, and therefore should not be used
for other purposes."
I wonder and ask myself whether the address of a C object isn't, in the
end, exactly that: an integer key?!
The use of the registry for the reference system seems to rely on two
premises: 1. that not many references are used simultaneously in an
application and 2. that any address coming from C is above a certain,
not clearly defined numerical threshold (which may well be true for most
(perhaps all?) architectures supported by Lua).
Still, these two statements somehow irritate me. But perhaps I'm
completely lost in the woods as to how these things hang together...?
web : http://thomaslauer.com/start