comp.lang.ada
 help / color / mirror / Atom feed
* Container for access values.
@ 2012-05-03  7:08 David Pettersson
  2012-05-03  7:56 ` Dmitry A. Kazakov
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: David Pettersson @ 2012-05-03  7:08 UTC (permalink / raw)


Hi!

If I want to store values of an access type in a Set, how do I do it. I want to implement a simple and inefficient garbage collector and need to store pointers (yes, coming from C) to objects that are roots for the scan for reachable objects.

If I try Hashed_Sets I get in trouble since I don't know how to compute a reasonable hash value for the access. I can do an unchecked cast to integer but the two methods for this that I know is not good for the purpose (?).

If I try Ordered_Sets there is no "<" defined for access and I have to define it myself in the same manner as hash value.

One problem with casting is that I might not get all the information if the destination is smaller than the size of the access (two words on gnat?). Or is it enought to use a long integer?

Is there a standard way to store accesses in Sets. Hashing the target will not work in this case since the targets value might change.

Any thoughts?
David



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-03 14:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-03  7:08 Container for access values David Pettersson
2012-05-03  7:56 ` Dmitry A. Kazakov
2012-05-03  8:26 ` David Pettersson
2012-05-03  8:40   ` Dmitry A. Kazakov
2012-05-03 14:18 ` Robert A Duff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox