bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: variables in yyparse


From: Paul Eggert
Subject: Re: variables in yyparse
Date: Sun, 19 Dec 2004 20:52:09 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

"Laurence Finston" <address@hidden> writes:

> Does this mean that what I've read about the memory layout of
> executable files is out of date?

That depends on what you've read.  :-)

glibc uses the Lea-Gloger allocator <http://www.malloc.de/en/>, which
as far as I know is documented only in the source code, though there
are some out-of-date design notes written by Doug Lea
<http://gee.cs.oswego.edu/dl/html/malloc.html>.

That being said, I've never heard of a GNU application assuming any of
the special properties of the Lea-Gloger allocator.  GNU code
generally tries to stick to the assumptions guaranteed by the glibc
manual, which are basically the same assumptions guaranteed by POSIX,
with the additional constraint that size-0 allocators (e.g.,
malloc(0)) always return a non-null pointer unless you've run out of
memory.

> Is the upshot that `bad_alloc' will never be thrown?

Sorry, I don't quite follow C++ and don't really know the difference
between the throwing forms of "new" and the others; but the bottom
line is that yes, if you keep allocating objects and never free them,
eventually you'll run out of memory (even on GNU systems :-).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]