comp.lang.ada
 help / color / mirror / Atom feed
From: al johnston <johnstona@avionics2.robins.af.mil>
Subject: Re: ??? Help!: how to do unconstraned arrays/records???
Date: 1998/11/05
Date: 1998-11-05T00:00:00+00:00	[thread overview]
Message-ID: <3641FDA2.812D683B@avionics2.robins.af.mil> (raw)
In-Reply-To: F1yoq0.Aqp.0.-s@inmet.camb.inmet.com

> : This looks dangerous to me because declaring an object of that type will
> : allocate stuff from the heap, which may cause a memory leak. I would
> : prefer explicit allocation (i.e. no default initial value for Nodes).
>
> In any case, I would generally agree with you that types

I was about to ask how do I deallocate this... my impression is if have
to create a looping structure... correct?

re, memory leak... this code only gets called once (at start up) so the impact

of any leak is minor.

>are dangerous.  Since the exercise was to create a type for
>heap allocation, it seemed OK to do it here.

Taft,

actually that wasnt the exercise... although it is probably the way I
misstated
my original request that caused the confussion.... I dont really need the
alloc-
ation to be done on heap... but rather that the allocateion of memory to be
"sized" at run time rather than at compile time.  at run time i get the
numhosts
and numnodes and size the array at that time....  now that may dictate
that the memory be allocated on the heap rather than otherwise... I dont
know... i sure dont understand the details of ada...  But the only reason
we are using pointers and "new" is because I couldnt convins ada's to
handle my requirmens for a "unconstraned" data struture....

anyway, your sollution is fine for my app...  and I have not seen a better
one suggested..

thanks again....






  reply	other threads:[~1998-11-05  0:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-04  0:00 ??? Help!: how to do unconstraned arrays/records??? al johnston
1998-11-04  0:00 ` Albert S. Johnston
1998-11-05  0:00   ` dewarr
1998-11-05  0:00     ` al johnston
1998-11-05  0:00       ` dewar
1998-11-05  0:00       ` Stephen Leake
1998-11-05  0:00 ` Tucker Taft
1998-11-05  0:00   ` Tucker Taft
1998-11-05  0:00     ` al johnston
1998-11-05  0:00   ` Tucker Taft
1998-11-05  0:00     ` Mats Weber
1998-11-05  0:00       ` Tucker Taft
1998-11-05  0:00         ` al johnston [this message]
1998-11-05  0:00           ` Tucker Taft
1998-11-06  0:00             ` Mats Weber
1998-11-06  0:00               ` Tucker Taft
replies disabled

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