From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4ea86b01a068c433,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.239.134 with SMTP id vs6mr1696115pbc.4.1336029270086; Thu, 03 May 2012 00:14:30 -0700 (PDT) Path: r9ni126390pbh.0!nntp.google.com!news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: David Pettersson Newsgroups: comp.lang.ada Subject: Container for access values. Date: Thu, 3 May 2012 00:08:42 -0700 (PDT) Organization: http://groups.google.com Message-ID: <3000608.845.1336028922599.JavaMail.geo-discussion-forums@vbvx4> NNTP-Posting-Host: 62.119.67.69 Mime-Version: 1.0 X-Trace: posting.google.com 1336029269 14613 127.0.0.1 (3 May 2012 07:14:29 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 3 May 2012 07:14:29 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=62.119.67.69; posting-account=Am55pwoAAACQPPEm7i2HtxJCmIOXoGZs User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-05-03T00:08:42-07:00 List-Id: 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