From: jsa@organon.com (Jon S Anthony)
Subject: Re: Q: memory management
Date: 1996/06/15
Date: 1996-06-15T00:00:00+00:00 [thread overview]
Message-ID: <JSA.96Jun15190253@organon.com> (raw)
In-Reply-To: uvv4tod9j9e.fsf@chaq.informatik.uni-tuebingen.de
In article <uvv4tod9j9e.fsf@chaq.informatik.uni-tuebingen.de> Hannes Haug <Hannes.Haug@Student.Uni-Tuebingen.de> writes:
> I'm new to Ada and have a question on memory management. Is
> there a function like malloc in Ada ? I want just a pointer
> to a certain amount of raw storage.
the reserved word _new_ in an allocator context. For example,
procedure Junk is
type string_ref is access string;
-- Dynamically allocate a string...
--
msg : string_ref := new string'(Hello Marion, is that you?);
....
end Junk;
> I think "new Storage_Array (n)" will give me a little bit too
> much storage. The array bounds need some space.
I don't know what "storage_array" is, but don't worry about the
space for bounds. It's all taken care of for you.
> Does "Allocate (some_storage_pool, addr, n, Word_Size / Storage_Unit)"
> work ? Which storage pool do I have to choose ?
At this point don't worry about user defined storage pools and
allocation/deallocation. Just use the standard predefined ones.
Have a look at access types in the rationale or in the Lovelace
tutorial:
http://lglwww.epfl.ch/Ada/
/Jon
--
Jon Anthony
Organon Motives, Inc.
1 Williston Road, Suite 4
Belmont, MA 02178
617.484.3383
jsa@organon.com
next prev parent reply other threads:[~1996-06-15 0:00 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-06-15 0:00 Q: memory management Hannes Haug
1996-06-15 0:00 ` Robert Dewar
1996-06-15 0:00 ` Jon S Anthony [this message]
1996-06-16 0:00 ` Robert Dewar
1996-06-18 0:00 ` Kent Mitchell
1996-06-16 0:00 ` Hannes Haug
1996-06-17 0:00 ` Tucker Taft
1996-06-17 0:00 ` Hannes Haug
1996-06-18 0:00 ` Hannes Haug
1996-06-18 0:00 ` Tucker Taft
1996-06-19 0:00 ` Hannes Haug
1996-06-18 0:00 ` Jon S Anthony
-- strict thread matches above, loose matches on Subject: below --
1996-06-19 0:00 W. Wesley Groleau (Wes)
1996-06-20 0:00 ` Hannes Haug
1996-06-20 0:00 ` Robert Dewar
1996-06-20 0:00 ` Hannes Haug
1996-06-21 0:00 ` Hannes Haug
1996-06-21 0:00 ` Robert Dewar
1996-06-25 0:00 ` Hannes Haug
1996-06-24 0:00 Q: Memory management W. Wesley Groleau (Wes)
1996-06-25 0:00 ` Hannes Haug
1996-06-25 0:00 ` Tucker Taft
[not found] ` <Dtzv4J.9FL@thomsoft.com>
1996-07-17 0:00 ` Robert Dewar
1996-06-25 0:00 ` Robert A Duff
1996-06-25 0:00 ` Jon S Anthony
1996-06-26 0:00 ` Robert Dewar
1996-06-27 0:00 ` Hannes Haug
[not found] <JSA.96Jun26142033@organon.com>
1996-06-27 0:00 ` Hannes Haug
1996-06-27 0:00 ` Robert A Duff
1996-06-27 0:00 ` Hannes Haug
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox