|What's wrong with alloca() ? firstname.lastname@example.org (1991-12-19)|
|Re: What's wrong with alloca() ? email@example.com (1991-12-15)|
|Re: What's wrong with alloca() ? firstname.lastname@example.org (1991-12-21)|
|Re: What's wrong with alloca() ? email@example.com (1991-12-22)|
|Re: What's wrong with alloca() ? firstname.lastname@example.org (1991-12-23)|
|Re: What's wrong with alloca() ? David.Chase@Eng.Sun.COM (1991-12-23)|
|Re: What's wrong with alloca() ? email@example.com (1991-12-26)|
|Re: What's wrong with alloca() ? firstname.lastname@example.org (1991-12-30)|
|Re: What's wrong with alloca() ? email@example.com (1991-12-30)|
|Re: What's wrong with alloca() ? firstname.lastname@example.org (1991-12-31)|
|Re: What's wrong with alloca() ? GORMAN_B@prime1.lancashire-poly.ac.uk (Barry Gorman) (1992-01-03)|
|Re: What's wrong with alloca() ? email@example.com (1992-01-05)|
|Re: What's wrong with alloca() ? firstname.lastname@example.org (1992-01-05)|
|[1 later articles]|
|From:||email@example.com (Piercarlo Grandi)|
|Organization:||Coleg Prifysgol Cymru|
|Date:||Thu, 26 Dec 1991 23:34:51 GMT|
On 22 Dec 91 18:08:57 GMT, firstname.lastname@example.org (Preston Briggs) said:
preston> email@example.com (David Keppel) writes:
pardo> By the time you've added these calls you're just about all the
pardo> way to having ``object stack'' allocation, called ``obstacks'' in
pardo> GNU terminology. An obstack is an allocation region that can be
pardo> used for incremental allocation and then freed all at once.
preston> I hadn't read of obstacks, but they sound like the "arenas"
preston> described in
preston> Fast Allocation and Deallocation of Memory Based on Object
preston> Lifetimes David R. Hanson Software - Practice and Experience
preston> January 1990, 20(1)
Actually alloca() and obstacks are variations on controlled storage
allocation in PL/1. alloca() and obstacks come from people that almost
certainly were using at some time Multics, and its PL/1 compiler.
preston> His implementation is very small and simple. [ ... ]
preston> However, alloca is still useful. In one example, I use it in a
preston> deeply recursive tree walk, allocating structures of different
preston> sizes. We don't want an arena or obstack, since different
preston> pieces become free at different times
If you want to allocate memory in a LIFO fashion, that's controlled
storage, in one form or another; if you want lifetimes not to be nested,
then it's heap storage. Maybe you are saying that you want to allocate
heaps in a LIFO fashion. Well, again in PL/1 there was a concept of
area, in which one could do nonnested allocations, and which could be
allocated in controlled storage.
Both controlled and area storage are very useful and important concepts;
in particular areas plus the idea of based (relative) pointers make it
possible to have efficient position independent data structures.
PL/1 had its interesting points... (controlled and area storage and
based pointers are actually present in other languages, like MUPL, but
not all together).
Piercarlo Grandi | ARPA: firstname.lastname@example.org
Dept of CS, UCW Aberystwyth | UUCP: ...!mcsun!ukc!aber-cs!pcg
Penglais, Aberystwyth SY23 3BZ, UK | INET: email@example.com
Return to the
Search the comp.compilers archives again.