lkml.org 
[lkml]   [2004]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [2.4.26] overcommit_memory documentation clarification
    On 2004-05-09 14:06:11 -0700, Paul Jackson wrote:
    > Vincent wrote:
    > > NULL == (void *) 0 and NULL == 0 must be true
    > Yes - NULL is compares equal to both (void *)0 and 0.
    > No - not necessarily the _same_ value - one could be
    > on a system with 32 bit ints, 64 bit pointers, for example.

    And so?

    > > The goal of malloc is to reserve memory.
    > It's up to the kernel whether sbrk (used by malloc to
    > obtain virtual address space) reserves memory or not.

    More old_mmap than brk (BTW, I forgot to say that this was on
    an x86 machine, I don't know if this matters...).

    > Check out:
    > /proc/sys/vm/overcommit_memory
    > Documentation/sysctl/vm.txt - overcommit_memory

    But the documentation is wrong (on an official 2.4.26 kernel).
    It seems that there is no way to get malloc() always return 0
    when there isn't enough memory, even in simple cases (see my
    program posted in the first message).

    --
    Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
    100% validated (X)HTML - Acorn / RISC OS / ARM, free software, YP17,
    Championnat International des Jeux Mathématiques et Logiques, etc.
    Work: CR INRIA - computer arithmetic / SPACES project at LORIA
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:03    [W:0.036 / U:179.452 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site