bash-2.05b and --without-bash-malloc

Matt Reppert arashi at
Mon May 12 06:39:03 PDT 2003

On Mon, 12 May 2003 12:14:29 +0100
Ian Molton <spyro at> wrote:

> On Sun, 11 May 2003 22:59:35 +0000 (UTC)
> gschafer at (Greg Schafer) wrote:
> > Anyone running a bash-2.05b configured with
> > --without-bash-malloc is running a suboptimal shell.
> OOI, what does it do? is it some kind of super fast malloc or soething?


     Use the Bash version of `malloc' in `lib/malloc/malloc.c'.  This
     is not the same `malloc' that appears in GNU libc, but an older
     version derived from the 4.2 BSD `malloc'.  This `malloc' is very
     fast, but wastes some space on each allocation.  This option is
     enabled by default.  The `NOTES' file contains a list of systems
     for which this should be turned off, and `configure' disables this
     option automatically for a number of systems.

Correspondingly, NOTES has:
1. configure --without-gnu-malloc on:

        alpha running OSF/1, Linux, or NetBSD (malloc needs 8-byte alignment;
        bash malloc has 8-byte alignment now, but I have no alphas to test on)

        next running NeXT/OS

        all machines running SunOS YP code: SunOS4, SunOS5, HP/UX, if you
        have problems with username completion or tilde expansion for
        usernames found via YP/NIS

        linux (optional, but don't do it if you're using Doug Lea's malloc)

        QNX 4.2
        other OSF/1 machines (KSR/1, HP, IBM AIX/ESA)
        sparc SVR4, SVR4.2 (ICL reference port)

        NetBSD/sparc (malloc needs 8-byte alignment; bash malloc has 8-byte
        alignment now, but I have no NetBSD machines to test on)

        BSD/OS 2.1, 3.x if you want to use loadable builtins

        Motorola m68k machines running System V.3.  There is a file descriptor
        leak caused by using the bash malloc because closedir(3) needs to read
        freed memory to find the file descriptor to close

--with-gnu-malloc is the same as --with-bash-malloc (configure told me so!).
That "linux (optional ... " line seems nice and cryptic to me, no? By the way,
recent glibc 2.3 uses Wolfram Gloger's malloc, which he says on the webpage is based on Doug Lea's malloc. glibc's malloc.c says
"This is a version (aka ptmalloc2) of malloc/free/realloc written by Doug Lea
and adapted to multiple threads/arenas by Wolfram Gloger." 

So ... we're using Doug Lea's malloc, it *looks* like bash documentation is
telling us "don't configure --without-bash-malloc". (I wonder why. Greg?)

Unsubscribe: send email to listar at
and put 'unsubscribe lfs-dev' in the subject header of the message

More information about the lfs-dev mailing list