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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10ad19,23963231b5359f74 X-Google-Attributes: gid10ad19,public X-Google-Thread: 107a89,23963231b5359f74 X-Google-Attributes: gid107a89,public X-Google-Thread: 103376,23963231b5359f74 X-Google-Attributes: gid103376,public X-Google-Thread: 1073c2,23963231b5359f74 X-Google-Attributes: gid1073c2,public X-Google-Thread: 10a146,23963231b5359f74 X-Google-Attributes: gid10a146,public X-Google-Thread: 101deb,23963231b5359f74 X-Google-Attributes: gid101deb,public X-Google-ArrivalTime: 2001-06-09 23:55:50 PST Path: archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news.stealth.net!news-east.rr.com!news.rr.com!portc03.blue.aol.com!news.compuserve.com!news-master.compuserve.com!not-for-mail From: "Mark Yudkin" Newsgroups: comp.lang.ada,comp.lang.awk,comp.lang.clarion,comp.lang.java.programmer,comp.lang.pl1,comp.lang.vrml Subject: Re: Memory Allocation without pointer arithmetic ? (was: Long names...) Date: Sun, 10 Jun 2001 08:56:07 +0200 Organization: CompuServe Interactive Services Message-ID: <9fv5ll$b0k$1@sshuraab-i-1.production.compuserve.com> References: <9f2nks$ibd$0@dosa.alt.net> <3B177EF7.2A2470F4@facilnet.es> <9f8b7b$h0e$1@nh.pace.co.uk> <9f8r0i$lu3$1@nh.pace.co.uk> <9fgagu$6ae$1@nh.pace.co.uk> <9fjgha$blf$1@nh.pace.co.uk> <35mqhtkdfma2rggv1htcaq6vfn2ihs67a1@4ax.com> <9fli1b$4aa$1@nh.pace.co.uk> NNTP-Posting-Host: fra-pci-lah-vty29.as.wcom.net X-Trace: sshuraab-i-1.production.compuserve.com 992156149 11284 212.211.68.29 (10 Jun 2001 06:55:49 GMT) X-Complaints-To: newsmaster@compuserve.com NNTP-Posting-Date: 10 Jun 2001 06:55:49 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.3018.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 Xref: archiver1.google.com comp.lang.ada:8503 comp.lang.awk:2958 comp.lang.clarion:21566 comp.lang.java.programmer:75058 comp.lang.pl1:957 comp.lang.vrml:3694 Date: 2001-06-10T06:55:49+00:00 List-Id: And since any PL/I programmer would just say AREAs and why don't you RTFM? - you can pull it from comp.lang.pl1 too. "Larry Kilgallen" wrote in message news:9BiaJoj4VeFk@eisner.encompasserve.org... > In article <3B219DB3.4BF2A68A@acm.org>, Patricia Shanahan writes: > > James Kanze wrote: > >> > >> Pete Thompson wrote: > >> > >> [...] > >> > Well, sure. Pointer arithmetic in C/C++ is inherently unsafe and > >> > encourages obfuscation. However, it also promotes flexibility. > >> > >> Just curious, but what can you do with pointer arithmetic in C/C++ > >> that you couldn't do otherwise, in a cleaner fashion? > > ... > > > > Manage memory. A memory allocator, such as malloc, or the corresponding > > kernel code, or the code underlying "new", has a split view of memory. > > It must perform calcuations to determine where to put the the newly > > created object. It must return a pointer to it. > > That is an interesting example, even though it should only occur once > per operating system. I have never tried to do that in Ada. > > Does anyone have experience trying to subdivide memory objects (the > free pool) without using the equivalent of pointer arithmetic ?