From: Jim Paradis <paradis@linux01.hlo.dec.com>
To: axp-list@redhat.com
Subject: Re: malloc oddity?
Date: Mon, 29 Jun 1998 16:10:18 -0400 (EDT) [thread overview]
Message-ID: <199806292010.QAA09705@linux01.hlo.dec.com> (raw)
In-Reply-To: <Pine.LNX.3.95.980629152602.13579A-100000@anubis.gsfc.nasa.gov> from "Mike Tripicco" at Jun 29, 98 03:32:56 pm
> Anyway, my problem is related to the fact that when I malloc anything more
> than 128kb the allocated memory suddenly jumps to a very high address:
>
> # testalloc 131048
> allocating 131048 bytes
> address is 0x150000250
>
> # testalloc 131049
> allocating 131049 bytes
> address is 0x15555568010
I'm just curious; why is this a problem? Surely you're not assuming
that malloc'ed memory is contiguous?! Malloc can return you a pointer
anywhere it pleases 8-)
Seriously; what you see is normal malloc behavior. The smaller malloc's
are being done as an sbrk() off the end of the program's data
segment, whereas the larger ones are being done as anonymous
mmap's(). In the case of 64-bit Alpha processes, mmap() starts
searching for free memory at 0x15555560000 (TASK_SIZE / 3, rounded
up to a page boundary).
> Running the same test program on an Alpha running OSF/1 v3.2 shows no such
> behavior. Is this related to the same bugs in the linker and/or assembler
> which cause the infamous "relocation truncated to fit" errors discussed
> back in April of 1997?
No relation whatsoever, just different mmap behavior.
--
Jim Paradis (paradis@linux01.hlo.dec.com) "The early bird gets the worm.
Digital Equipment Corporation If you want something else for
(508)841-3243 breakfast, get up later."
http://www.tiac.net/users/jrp/index.html
next prev parent reply other threads:[~1998-06-29 20:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-06-29 19:32 malloc oddity? Mike Tripicco
1998-06-29 20:10 ` Jim Paradis [this message]
1998-06-29 21:39 ` Mike Tripicco
1998-06-29 22:20 ` Richard Henderson
-- strict thread matches above, loose matches on Subject: below --
1998-06-30 21:23 Larry Zimmerman
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox