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=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8acd4291c317f897 X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,8acd4291c317f897 X-Google-Attributes: gid109fba,public From: Mats Weber Subject: Re: Safety of the Booch Ada 95 Components Date: 1999/12/15 Message-ID: <38576982.1CBD1984@mail.com>#1/1 X-Deja-AN: 560912365 Content-Transfer-Encoding: 7bit References: <1e2lds4.7trgj21rgj9i0N%herwin@gmu.edu> <38512921_3@news1.prserv.net> <3851c7b9_4@news1.prserv.net> <38558788.33C493B@mitre.org> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sunrise.ch X-Trace: news1.sunrise.ch 945252738 28219 195.141.231.162 (15 Dec 1999 10:12:18 GMT) Organization: sunrise communications ag Mime-Version: 1.0 NNTP-Posting-Date: 15 Dec 1999 10:12:18 GMT Newsgroups: comp.lang.ada,comp.lang.c++ Date: 1999-12-15T10:12:18+00:00 List-Id: Simon Wright wrote: > I'm going to do a deep copy. > > I have an object containing a pointer to the value that has been > assigned, so I need to make the deep copy and then put a pointer to > the copy in the current object. > > If that fails, presumably because of memory exhaustion, I can > > (1) make sure that the assignee has a valid but partial copy > > (2) make sure that the assignee has a null pointer > > (3) leave the assignee pointing to the value that has been assigned, > so that the copy isn't deep after all > > (4) not bother (5) raise or propagate and exception. I think this is the only right thing to do. Being tagged, controlled types are passed by reference, so you can also make sure the target of the assignement has a null pointer. > In *none* of these cases is the assignee "valid". Whether that equates > to being "corrupt" is a question I prefer to leave to the reader .. How could it possibly be valid if memory is exhausted, in any programming language ?