Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Oct 1997 07:02:48 -0400 (GMT-0400)
From:      Snob Art Genre <ben@multivac.narcissus.net>
To:        Doug White <dwhite@resnet.uoregon.edu>
Cc:        Jason Alan Nordwick <nordwick@graft.xcf.berkeley.edu>, questions@FreeBSD.ORG
Subject:   Re: more kernel/libc questions.
Message-ID:  <Pine.NXT.3.96.971013070040.3179B-100000@multivac.narcissus.net>
In-Reply-To: <Pine.BSF.3.96.971012233913.9609T-100000@gdi.uoregon.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 12 Oct 1997, Doug White wrote:

> This bit on the brk(2) man page implies to me that they don't do anything
> useful:

% uname -a
FreeBSD thorazine.neuron.net 2.2-STABLE FreeBSD 2.2-STABLE #0: Sun Aug 31
15:20:36 EDT 1997
root@thorazine.neuron.net:/usr/src/sys/compile/THORAZINE  i386

% grep brk /usr/src/lib/libc/stdlib/malloc.c
static void *malloc_brk;
    result = (caddr_t)pageround((u_long)sbrk(0));
    if (brk(tail)) {
    malloc_brk = tail;
    malloc_origo = ((u_long)pageround((u_long)sbrk(0))) >>
	malloc_pageshift;
     * We can sbrk(2) further back when we keep this on a low address.
        if ((void*)pf->page >= (void*)sbrk(0))
            wrterror("(ES): entry on free_list past brk\n");
      pf->end == malloc_brk &&                /* ..and none behind us,*/
      malloc_brk == sbrk(0)) {                /* ..and it's OK to do...*/
        brk(pf->end);
        malloc_brk = pf->end;


> Doug White                              | University of Oregon  
> Internet:  dwhite@resnet.uoregon.edu    | Residence Networking Assistant
> http://gladstone.uoregon.edu/~dwhite    | Computer Science Major



 Ben

"You have your mind on computers, it seems." 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NXT.3.96.971013070040.3179B-100000>