ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Michael Shigorin <mike@osdn.org.ua>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] q: glibc malloc s*cks?
Date: Tue, 16 Jan 2007 00:37:28 +0200
Message-ID: <20070115223727.GG30292@osdn.org.ua> (raw)
In-Reply-To: <20070115213303.GA6086@osdn.org.ua>

On Mon, Jan 15, 2007 at 11:33:03PM +0200, sr@altlinux.ru wrote:
> > Скажите sr@, что glibc malloc уже давно использует mmap.
> > См. тж. http://sourceware.org/ml/libc-alpha/2006-11/msg00061.html
> Агащазблин.

Скажем так -- "умеет использовать mmap", посмотри "Update in 2006:"
по второй ссылке на libc-alpha@ (или в malloc.c@~1480) для
уточнения нынешнего изменения порога между mmap и brk.

> $ echo "int main() { return malloc( 1) ? 0 : 1; }" > 1.c
> $ gcc 1.c
> $ strace ./a.out
[...]
> brk(0)                                  = 0x804a000
> brk(0x806b000)                          = 0x806b000
> exit_group(0)                           = ?
> Process 6119 detached

$ echo "int main() { return malloc( 2000000 ) ? 0 : 1; }" > 2.c
$ gcc 2.c
2.c: In function 'main':
2.c:1: warning: incompatible implicit declaration of built-in function 'malloc'
$ strace ./a.out 
execve("./a.out", ["./a.out"], [/* 71 vars */]) = 0
brk(0)                                  = 0x804a000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f0f000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=135213, ...}) = 0
mmap2(NULL, 135213, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7eed000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\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(3, {st_mode=S_IFREG|0755, st_size=1171776, ...}) = 0
mmap2(NULL, 1177860, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7dcd000
mmap2(0xb7ee7000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x11a) = 0xb7ee7000
mmap2(0xb7eea000, 10500, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7eea000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7dcc000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7dcc6c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xb7ee7000, 4096, PROT_READ)   = 0
munmap(0xb7eed000, 135213)              = 0
mmap2(NULL, 2002944, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7be3000
exit_group(0)                           = ?
Process 10194 detached

> $ rpm -q glibc
> glibc-2.5-alt3

ditto, i586

-- 
 ---- WBR, Michael Shigorin <mike@altlinux.ru>
  ------ Linux.Kiev http://www.linux.kiev.ua/


  reply	other threads:[~2007-01-15 22:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-15 13:59 Michael Shigorin
2007-01-15 14:13 ` Dmitry V. Levin
2007-01-15 18:01   ` Michael Shigorin
2007-01-15 21:33   ` sr
2007-01-15 22:37     ` Michael Shigorin [this message]
2007-01-15 23:18       ` sr
2007-01-16  1:26         ` Dmitry V. Levin
2007-01-16  9:35           ` Michael Shigorin
2007-01-16 17:46           ` [devel] [JT] " Денис Смирнов
2007-01-15 23:19     ` [devel] q: " Dmitry V. Levin
2007-01-15 19:19 ` Денис Смирнов
2007-01-15 21:38   ` sr
2007-01-15 22:22     ` Konstantin A. Lepikhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070115223727.GG30292@osdn.org.ua \
    --to=mike@osdn.org.ua \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git