malloc source code - Minix

This is a discussion on malloc source code - Minix ; Which is the purpose of running twice the code of malloc.c? I refer to the following line of src/lib/ansi/malloc.c: for (ntries = 0; ntries I suspect it is a hopeless try of a process to allocate more memory from another ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: malloc source code

  1. malloc source code

    Which is the purpose of running twice the code of malloc.c? I refer to the
    following line of src/lib/ansi/malloc.c:

    for (ntries = 0; ntries < 2; ntries++) {

    I suspect it is a hopeless try of a process to allocate more memory from
    another process that has just freed some

    Christos



  2. Re: malloc source code

    In article <1134139009.442951@athnrd02>,
    Christos Karayiannis wrote:
    >Which is the purpose of running twice the code of malloc.c? I refer to the
    >following line of src/lib/ansi/malloc.c:
    >
    >for (ntries = 0; ntries < 2; ntries++) {
    >
    >I suspect it is a hopeless try of a process to allocate more memory from
    >another process that has just freed some


    Are you sure that all that other code in the loop is actually a nop?


    --
    That was it. Done. The faulty Monk was turned out into the desert where it
    could believe what it liked, including the idea that it had been hard done
    by. It was allowed to keep its horse, since horses were so cheap to make.
    -- Douglas Adams in Dirk Gently's Holistic Detective Agency

+ Reply to Thread