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,1040b0f89bdadc61 X-Google-Attributes: gid103376,public From: kilgallen@eisner.decus.org (Larry Kilgallen) Subject: Re: pointers , space requirements Date: 1996/12/19 Message-ID: <1996Dec19.170524.1@eisner>#1/1 X-Deja-AN: 204992611 x-nntp-posting-host: eisner.decus.org references: <59c832$4gg@corn.cso.niu.edu> x-nntp-posting-user: KILGALLEN x-trace: 851033132/15102 organization: LJK Software newsgroups: comp.lang.ada Date: 1996-12-19T00:00:00+00:00 List-Id: In article <59c832$4gg@corn.cso.niu.edu>, system@niuhep.physics.niu.edu writes: > I am mapping out the memory requirements for a programming > project that makes use of lots of pointers (excuse me, of access > variables :). And I haven't a clue as to how much space a pointer > takes up. > Will this vary by hardware? This program will be compiled > and run (hopefully) both on a Pentium under OS/2 and on an Alpha > under Digital Unix (and possibly under VMS). > So could y'all give me a ballpark figure for the memory > allocation of a pointer? This depends not only on the operating system but also the compiler. DEC Unix requires 64 bit addresses, whereas DEC Ada on VMS uses only 32 bits (regardless of whether it is VAX or Alpha). Someone from ACT can comment on whether their forthcoming GNAT release for VMS will support 64 bit addresses or just 32 bits. It is possible, of course, for an "access variable", to take a lot more memory by including extra trace information, but I am not aware of any compilers that create access variables in that fashion. But DEC Unix and VMS are both virtual memory operating systems, so to some level of approximation more memory is "free". In such situations planning out your access patterns and resultant paging behaviour (which is fairly independent of programming language) is more important. There are pathological situations where the size of access variables might dominate the problem, but in most cases there is more "data" (stuff gotten via the access variables) than there is space devoted to access variables. If you have access variables pointing to arrays of access variables pointing to more arrays of access variables, all of which end up pointing to just two static strings: "Yes" and "No!" then indeed the size of access variables may dominate your problem, but in most cases it does not. Larry Kilgallen