Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!uflorida!gatech!hubcap!billwolf From: billwolf@hubcap.clemson.edu (William Thomas Wolfe,2847,) Newsgroups: comp.lang.ada Subject: Re: Garbage Collection Message-ID: <3861@hubcap.UUCP> Date: 13 Dec 88 18:37:34 GMT References: <6702@june.cs.washington.edu> Sender: news@hubcap.UUCP Reply-To: wtwolfe@hubcap.clemson.edu Lines: 29 From article <6702@june.cs.washington.edu>, by klaiber@june.cs.washington.edu (Alexander Klaiber): > Assume I maintain mailing-lists of people and I represent the lists by > pointers to objects representing one person each; i.e. > > type person is (some adt) > type mailinglist is new list(person); > > Now if I have more than one mailing-list, obviously I have structure-sharing: > a given person may appear on more than one list. No, this isn't structural sharing, because you are explicitly manipulating a list of pointers. Structural sharing occurs when you have two objects, A and B, and making some modification to B causes a modification to A as well, because they share a portion of their structure. The structure of a pointer is simply the address field, and the address fields are not being shared. Now if we had two ADTs, both implemented by *hidden* pointers, and assignment failed to result in a deep copy, then THAT would be structural sharing. In this particular instance, it would be best to store the key by which a person could be identified (social security number, for example) in the list, and then using the key to retrieve the current address from the Person database. Thus, a mailing list would be a list of social security numbers. Bill Wolfe wtwolfe@hubcap.clemson.edu