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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,8acd4291c317f897 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,8acd4291c317f897 X-Google-Attributes: gid103376,public From: xanthian@well.com (Kent Paul Dolan) Subject: Re: Safety of the Booch Ada 95 Components Date: 1999/12/13 Message-ID: #1/1 X-Deja-AN: 560011723 References: <1e2lds4.7trgj21rgj9i0N%herwin@gmu.edu> <3851c7b9_4@news1.prserv.net> <1e2ns7h.cx85ir1azwo9iN%herwin@gmu.edu> <82up01$ddg$1@nnrp1.deja.com> X-Complaints-To: news@wenet.net X-Trace: news.wenet.net 945078712 208.178.101.2 (Mon, 13 Dec 1999 01:51:52 PST) Organization: Birthright Party "The birthright of humankind is the stars!" Reply-To: xanthian@well.com (Kent Paul Dolan) NNTP-Posting-Date: Mon, 13 Dec 1999 01:51:52 PST Newsgroups: comp.lang.ada,comp.lang.c++ Date: 1999-12-13T00:00:00+00:00 List-Id: Robert Dewar wrote: > herwin@gmu.edu (Harry Erwin) wrote: >> A deep copy of a pointer data structure may require more >> memory than is available. >A naive copy may have that characteristic, but it is always >possible on modern machines to do such a copy with no additional >storage. It just takes a bit of cleverness. Remember that every >pointer has at least two spare bits. This one sets alarm bells ringing like crazy. I was a user of AmigaBASIC, whose developers assumed that the 24 bits in use of 32 bit pointers they saw when the machine in an early OS rev would be the law forever, ignored the developer manuals warnings to the contrary, used the other 8 bits for string lengths or some such, in a petty search for "efficiency" at the expense of clean coding, and had their software die a horrible death when the OS was upgraded within a couple of years to use all 32 bits of a pointer. I can already trick out a Mac G4 box with a gig of physical memory for an obscene price, (but lower than the tag on a pretty old used car, and less than the cost of a megabyte of memory retail in 1981), and not one revision down the line support for a second gig will be in place, one of your spare pointer bits has disappeared and gone, and your code is broken. Did you remember to instrument the breaks to be easily located, and pre-design a workaround for conditional compilation or conditional linking into place? Some "efficiencies" aren't worth the risk, and the damage to pointer semantics of using some bits for "non-pointer purposes" would be nearly incalculable. Oh, and did you lock your structures against traversal by other threads while the (possibly time consuming) deep copy was ongoing, or are the munged pointers going to be visible outside the deep copy process? [I'd say "I am but an egg" here, w.r.t. my compiler writing near non-experience, but some "eggs" hatched out moa birds, after all.] -- Kent Paul Dolan. Using modern technology to commit errors at previously unachievable rates.