public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Ángel González" <keisial@gmail.com>
To: Anna Sidera <sidera.anna@ucy.ac.cy>
Cc: gcc-help@gcc.gnu.org
Subject: Re: how to use malloc to reserve space for 1 billion floats
Date: Tue, 28 Aug 2012 13:12:00 -0000	[thread overview]
Message-ID: <503CA892.1060903@gmail.com> (raw)
In-Reply-To: <f5c7a4293ffd9.503c6c12@ucy.ac.cy>

On 28/08/12 05:58, Anna Sidera wrote:
> The system has 10 giga byte RAM.
>
> The command:
> uname -a
> gives the following output:
> Linux olympus 2.6.26-2-amd64 #1 SMP Wed Aug 19 22:33:18 UTC 2009 x86_64 GNU/Linux
> I think this means that the system is 64 bit.
It does.

> So you think that the command:
> int myvariable = 1000;
> float *myarray = malloc(pow(myvariable,3)*sizeof(float));
> will work if pow(myvariable,3) is smaller than 2 billion?
>
> Many Thanks,
> Anna
Yes. (the 2+e9 limit being roughly for the 7,45GB needed, not due to
malloc, to which you
could ask for even bigger amounts )

      reply	other threads:[~2012-08-28 11:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-27 11:16 how to use malloc to reserve space for 1 million floats Anna Sidera
2012-08-27 16:15 ` Jonathan Wakely
2012-08-27 16:23 ` Ángel González
2012-08-28 11:18   ` how to use malloc to reserve space for 1 billion floats Anna Sidera
2012-08-28 13:12     ` Ángel González [this message]

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=503CA892.1060903@gmail.com \
    --to=keisial@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=sidera.anna@ucy.ac.cy \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).