comp.lang.ada
 help / color / mirror / Atom feed
* pointers , space requirements
@ 1996-12-19  0:00 system
  1996-12-19  0:00 ` Larry Kilgallen
  1996-12-20  0:00 ` Robert Dewar
  0 siblings, 2 replies; 3+ messages in thread
From: system @ 1996-12-19  0:00 UTC (permalink / raw)



Hi,
	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?

Robert

specify the e-mail address below, my reply-to: has anti-spam added to it
Morphis@physics.niu.edu
Real Men change diapers




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pointers , space requirements
  1996-12-19  0:00 pointers , space requirements system
@ 1996-12-19  0:00 ` Larry Kilgallen
  1996-12-20  0:00 ` Robert Dewar
  1 sibling, 0 replies; 3+ messages in thread
From: Larry Kilgallen @ 1996-12-19  0:00 UTC (permalink / raw)



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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pointers , space requirements
  1996-12-19  0:00 pointers , space requirements system
  1996-12-19  0:00 ` Larry Kilgallen
@ 1996-12-20  0:00 ` Robert Dewar
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Dewar @ 1996-12-20  0:00 UTC (permalink / raw)



Robert asks

"        So could y'all give me a ballpark figure for the memory
allocation of a pointer?

Robert"



A rather odd question!

The pointer itself takes up one or possibly two words, but presumabvly
you have to account for the memory reqwuired for the data referenced
by the ointer.

The ballpark requirements for the referenced memory are in the range
one byte (for a one byte string referenced by a pointer) to 
4 gigabytes (for a 4 gig string referenced by a pointer). Of course
if you have a machine with 64-bit addressing, these estimates are
far too narrow :-)





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1996-12-20  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-12-19  0:00 pointers , space requirements system
1996-12-19  0:00 ` Larry Kilgallen
1996-12-20  0:00 ` Robert Dewar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox