[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [f-cpu] optional SRB



Hey, Yann ! can you imagine to allocate a huge memory block and to access
all its range in a very short time ? usually, a programs works only on a
small part of the memory block, so it is more judicious to let the virtual
memory to map the necessary physical page and makes the swap when necessary.

Don't forget, malloc() and free() are not exactly POSIX functions and they
don't belong to kernel functions but to user functions. So instead of using
the obsolete sbreak() function to handle malloc() and free() functions, it
make more sense to use mmap() instead to allocate the necessary heaps since
it the application which handle those heaps, not the kernel. I could even
say that the mmap() is the only way for the application to allocate heaps
for its own malloc() and free() usage.

----- Original Message -----
From: "Michael Riepe" <michael@stud.uni-hannover.de>
To: <f-cpu@seul.org>
Sent: Monday, November 25, 2002 11:23 AM
Subject: Re: [f-cpu] optional SRB


> On Mon, Nov 25, 2002 at 02:52:01AM +0100, Yann Guidon wrote:
>
> > PS : i recently attended a conference about GNU/Hurd and i have
> > seen some Hurd sourcec code. It's very far from POSIX but
> > one of the most crazy things i've seen is ... mmap() used for doing
> > a malloc() .....
>
> Huh? Linux (glibc) does that all the time (and has been doing it for
> many years), if the requested size is big enough.
>
> --
>  Michael "Tired" Riepe <Michael.Riepe@stud.uni-hannover.de>
>  "All I wanna do is have a little fun before I die"
> *************************************************************
> To unsubscribe, send an e-mail to majordomo@seul.org with
> unsubscribe f-cpu       in the body. http://f-cpu.seul.org/

*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/