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,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: Simon Wright Subject: Re: Safety of the Booch Ada 95 Components Date: 1999/12/13 Message-ID: #1/1 X-Deja-AN: 560260243 X-NNTP-Posting-Host: pogner.demon.co.uk:158.152.70.98 References: <1e2lds4.7trgj21rgj9i0N%herwin@gmu.edu> <3851c7b9_4@news1.prserv.net> <1e2ns7h.cx85ir1azwo9iN%herwin@gmu.edu> <82up01$ddg$1@nnrp1.deja.com> X-Trace: news.demon.co.uk 945121739 nnrp-01:11362 NO-IDENT pogner.demon.co.uk:158.152.70.98 Organization: At Home Newsgroups: comp.lang.ada,comp.lang.c++ X-Complaints-To: abuse@demon.net Date: 1999-12-13T00:00:00+00:00 List-Id: xanthian@well.com (Kent Paul Dolan) writes: > 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 suspect Robert was thinking of the low-order 2 bits (on the assumption that malloc() always returns something longword-aligned. I rather thought it was often 16-byte-aligned??).