linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Uriel Corfa <uriel@corfa.fr>
To: ratheesh k <ratheesh.ksz@gmail.com>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: malloc
Date: Mon, 27 Dec 2010 19:51:27 +0100	[thread overview]
Message-ID: <AANLkTi=UXZrj4uLQbbr7iBERsjPCru2zv_SQsnga2mg+@mail.gmail.com> (raw)
In-Reply-To: <AANLkTi=y+++cekRzdH5WMNWOyRg1=TaA6eAeq1dL9+A0@mail.gmail.com>

On Mon, Dec 20, 2010 at 5:39 AM, ratheesh k <ratheesh.ksz@gmail.com> 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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2010-12-27 18:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-20  4:39 malloc ratheesh k
2010-12-20  4:43 ` malloc Santosh Sivaraj
2010-12-27 18:51 ` Uriel Corfa [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-06-17 21:26 malloc Earl R. Lapus
2002-06-17 13:48 ` malloc Glynn Clements
2002-06-17 14:32 ` malloc Jason P. Winters
2002-06-17 16:47 ` malloc Mehran Rezaei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTi=UXZrj4uLQbbr7iBERsjPCru2zv_SQsnga2mg+@mail.gmail.com' \
    --to=uriel@corfa.fr \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=ratheesh.ksz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).