• gcc displaying bullshit allocation numbers? (was: Re: Ability to furthe

    From Bastian Blank@21:1/5 to Bastian Blank on Sat Jan 13 18:00:01 2024
    XPost: linux.debian.maint.glibc

    Hi

    On Thu, Jan 11, 2024 at 10:25:39AM +0100, Bastian Blank wrote:
    Linux 6.7 fails to build on at least i386 and armhf. Even it now
    manages to make the compiler fail to allocate memory:
    | cc1: out of memory allocating 135266296 bytes after a total of 235675648 bytes

    I just tried to find out what this numbers actually mean.

    The first on is the allocation amount, so correct. The printf spec is
    however wrong, as the variable is a size_t (%zu) and not unsigned long
    (%lu).

    The second one is the return value of "sbrk(0) - $saved sbrk value".

    https://github.com/gcc-mirror/gcc/blob/master/libiberty/xmalloc.c#L125-L132

    The glibc malloc(3), which seems to be used in the background, uses both
    brk(2) and malloc(2), so you can't really see how much you have ever
    allocated using this technique.

    Am I right in this?

    Bastian

    --
    "Life and death are seldom logical."
    "But attaining a desired goal always is."
    -- McCoy and Spock, "The Galileo Seven", stardate 2821.7

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)