Re: malloc

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

 



On Mon, Dec 20, 2010 at 5:39 AM, ratheesh k <ratheesh.ksz@xxxxxxxxx> wrote:
> Is the below statement right or wrong ?
>
> malloc tries to allocate continous memmory space in virtual address
> space.  not in physical address space.

Hi,

This is true, but in theory, malloc doesn't have a notion of a virtual
or physical address space. Malloc is defined as : it tries to allocate
a contiguous memory chunk of at least the required size in a
system-defined pool. The question of setting up virtual address
spaces, of lazy allocation of physical pages, etc. is left up to the
underlying OS. In other terms : it's mmap(2) and brk(2) that take care
of this. Malloc relies on them for this kind of questions.

Regards,

-- 
Uriel Corfa
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux