[devel] q: glibc malloc s*cks?
=?iso-8859-1?q?sr_=CE=C1_altlinux=2Eru?=
=?iso-8859-1?q?sr_=CE=C1_altlinux=2Eru?=
Вт Янв 16 00:33:03 MSK 2007
On Mon, Jan 15, 2007 at 05:13:42PM +0300, Dmitry V. Levin wrote:
> Скажите sr@, что glibc malloc уже давно использует mmap.
> См. тж. http://sourceware.org/ml/libc-alpha/2006-11/msg00061.html
Агащазблин.
$ echo "int main() { return malloc( 1) ? 0 : 1; }" > 1.c
$ gcc 1.c
$ strace ./a.out
execve("./a.out", ["./a.out"], [/* 49 vars */]) = 0
brk(0) = 0x804a000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=62887, ...}) = 0
mmap2(NULL, 62887, PROT_READ, MAP_PRIVATE, 4, 0) = 0xb7f82000
close(4) = 0
open("/lib/libc.so.6", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\232b\1"..., 512) = 512
fstat64(4, {st_mode=S_IFREG|0755, st_size=1167868, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f81000
mmap2(NULL, 1173764, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0xb7e62000
mmap2(0xb7f7b000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x119) = 0xb7f7b000
mmap2(0xb7f7e000, 10500, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f7e000
close(4) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7e61000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7e616c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xb7f7b000, 4096, PROT_READ) = 0
munmap(0xb7f82000, 62887) = 0
brk(0) = 0x804a000
brk(0x806b000) = 0x806b000
exit_group(0) = ?
Process 6119 detached
$ rpm -q glibc
glibc-2.5-alt3
Подробная информация о списке рассылки Devel