Joseph D. Wagner wrote:

> I'm trying to write a tracer on memory allocation, and I'm having a little
> trouble figuring this out.
> 
> At some point, malloc has to call the kernel to tell it to allocate more
> memory for this user process, right?  I can't figure out which function
> malloc calls, or where in the code (line number) it's called.

malloc can use either sbrk/brk or (anonymous) mmap to obtain more
memory from the kernel.

> I'm looking at glib-2.3.1 to try and find my answers.  After all, that's
> where malloc is defined, right?

It's in glibc (GNU libc), not glib (the GNOME utility library).

-- 
Glynn Clements <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to