Opened 10 years ago

#345 new defect

sbrk() and high-memory

Reported by: KO Myung-Hun Owned by:
Priority: normal Milestone: libc-0.7
Component: libc Version: 0.6.6
Severity: normal Keywords:
Cc:

Description

Hi/2.

sbrk() seems not to support high-memory, maybe brk(), too. For example,

#include <stdio.h>
#include <stdlib.h>

int main( void )
{
    printf("Before, sbrk(0) = %p\n", sbrk( 0 ));
    printf("malloc() = %p\n", malloc( 1024 * 1024 * 128UL ));
    printf("After, sbrk(0) = %p\n", sbrk( 0 ));

    return 0;
}

Without -Zhigh-mem,

Before, sbrk(0) = 0x2180000
malloc() = 0x42d0040
After, sbrk(0) = 0xc2e0000

With -Zhigh-mem,

Before, sbrk(0) = 0x2180000
malloc() = 0x21030040
After, sbrk(0) = 0x2180000

In case of -Zhigh-mem, sbrk() is not affected by malloc().

Change History (0)

Note: See TracTickets for help on using tickets.