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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3c37d6ac44550e08 X-Google-Attributes: gid103376,public From: al johnston Subject: Re: ??? Help!: how to do unconstraned arrays/records??? Date: 1998/11/05 Message-ID: <3641FDA2.812D683B@avionics2.robins.af.mil>#1/1 X-Deja-AN: 408764216 Content-Transfer-Encoding: 7bit References: <3641D77A.C7AB597@elca-matrix.ch> Content-Type: text/plain; charset=us-ascii Organization: Robins AFB, GA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-11-05T00:00:00+00:00 List-Id: > : 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....