comp.lang.ada
 help / color / mirror / Atom feed
From: adoyle@bbn.com (Allan Doyle)
Subject: Re: C Strings in Ada?
Date: 11 Jun 90 19:59:38 GMT	[thread overview]
Message-ID: <57290@bbn.BBN.COM> (raw)
In-Reply-To: EMERY.90Jun11135320@scorpio.linus.mitre.org

In article <EMERY.90Jun11135320@scorpio.linus.mitre.org>
 emery@linus.mitre.org (David Emery) writes:
>Allan Doyle writes
>>If I take the worst case assumption that c_string
>>is being allocated from the heap and add it to the worst case assumption
>>that my Ada run-time will not be doing garbage collection (perfectly legal,
>>I understand), then how many of these little beasties can I convert from
>>Ada to C before I run out of memory?
>
>It's not clear to me that you can guarantee with a C compiler that
>there is not some compiler-generated heap, either.  Does the C
>LANGUAGE guarantee non-heap allocation for a local variable???    Or
>does "everyone knows that's how it's done?"
>
> 				dave emery
>				emery@aries.mitre.org


Touche' - I just looked in K&R and found no statement concerning
automatic variables and the memory they occupy. It only states that
the variables "disappear" from scope.

By the way, the example I gave in the previous post:

	declare
		c_string : constant string := "foo" & ascii.nul;

would take up heap in C as well. I really meant 

	proc(foo: string) is
		c_string : constant string := foo & ascii.nul;
	...

which everybody "knows" will go on the stack in C...(sigh)





Allan Doyle                                        adoyle@bbn.com
BBN Systems and Technologies Corporation           (617) 873-3398
70 Fawcett Street,   Cambridge, MA 02138

  reply	other threads:[~1990-06-11 19:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-06-04 22:45 C Strings in Ada? Andy DeFaria
1990-06-07 17:41 ` stt
1990-06-08 16:00 ` Andy DeFaria
1990-06-10 20:38   ` Alex Blakemore
1990-06-11 12:57     ` Allan Doyle
1990-06-11 14:59       ` David Kassover
1990-06-11 19:48         ` Allan Doyle
1990-06-11 21:01           ` David Kassover
1990-06-11 22:30           ` Mike Murphy
1990-06-13 21:20           ` Edward Falis
1990-06-11 17:53       ` David Emery
1990-06-11 19:59         ` Allan Doyle [this message]
1990-06-15  7:53   ` Jeff Bartlett
1990-06-11 22:39 ` Andy DeFaria
1990-06-12 14:04   ` David Emery
1990-06-12 18:11   ` Mike Murphy
1990-06-13 13:43 ` stt
replies disabled

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