comp.lang.ada
 help / color / mirror / Atom feed
From: David Pettersson <jan.karv@gmail.com>
Subject: Container for access values.
Date: Thu, 3 May 2012 00:08:42 -0700 (PDT)
Date: 2012-05-03T00:08:42-07:00	[thread overview]
Message-ID: <3000608.845.1336028922599.JavaMail.geo-discussion-forums@vbvx4> (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



             reply	other threads:[~2012-05-03  7:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-03  7:08 David Pettersson [this message]
2012-05-03  7:56 ` Container for access values 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
replies disabled

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