(no subject)

From: leechin@ucsb.edu
Date: Tue Feb 08 2000 - 17:34:28 EST


So when I use malloc with a small size, it tries to malloc from the heap and on big sizes (what is big BTW?) it automatically allocs from the mmap region... is this correct?

Also, even though I have enough memory in the mmap region, malloc will not use it on small sizes... is this correct?

Thank you very much :)

Followup to: <200002081613.RAA09330@cave.bitwizard.nl>
By author: R.E.Wolff@BitWizard.nl (Rogier Wolff)
In newsgroup: linux.dev.kernel
>
> Another thing to keep in mind is that to allow efficient
> allocation/deallocation, there may be some rounding going on. The 2.0
> kmalloc would round 1024 to 2048 and therefore waste almost half the
> RAM.
>
> > Problem is that libc malloc() appears to use brk() only, so
>
> glibc will use mmap to implement "malloc". libc5 probably uses brk.
>

libc5 used mmap() as well, at least the recent versions. It even
supported mremap() for realloc().

          -hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Feb 15 2000 - 21:00:14 EST