G
Guest
i'm looking for a possibility in C# to get a unique Int32 handle for an
object reference. This handle must later (within the same process of course)
be convertible back to an object reference (call it handle or pointer or
whatever...).
at the moment i'm working with a Hashtable Int32 to Object, but i want to
optimize this. I know it is possible to work with pointers in unsafe code
blocks, but as far as i know these pointer remain valid only within these
blocks, or when they are pinned. and i don't want to disturb the garbage
collector.
i mean, somehow a reference must be a number anyway, perhaps an index within
some garbage collector table, or am i wrong?
object reference. This handle must later (within the same process of course)
be convertible back to an object reference (call it handle or pointer or
whatever...).
at the moment i'm working with a Hashtable Int32 to Object, but i want to
optimize this. I know it is possible to work with pointers in unsafe code
blocks, but as far as i know these pointer remain valid only within these
blocks, or when they are pinned. and i don't want to disturb the garbage
collector.
i mean, somehow a reference must be a number anyway, perhaps an index within
some garbage collector table, or am i wrong?