From: Glynn Clements <glynn.clements@virgin.net>
To: "William N. Zanatta" <william@veritel.com.br>
Cc: "'linux-c-programming@vger.kernel.org'"
<linux-c-programming@vger.kernel.org>
Subject: Re: GCC and Memory Organization
Date: Tue, 9 Apr 2002 23:12:15 +0100 [thread overview]
Message-ID: <15539.26431.760192.203498@cerise.nosuchdomain.co.uk> (raw)
In-Reply-To: <3CB3039C.4070404@veritel.com.br>
William N. Zanatta wrote:
> I have a question on memory organization...
> In my Computer Architeture classes, I've learned something like that
> there are two ways to organize data in memory.
> The first one puts it in a linear mode like:
>
> +---------------+
> 12k | z | z | | |
> |---------------|
> 8k | y | y | z | z |
> |---------------|
> 4k | x | x | x | y |
> +---------------+
>
> And the second way is a non-linear, a block mode like:
>
> +---------------+
> 12k | z | z | z | z |
> |---------------|
> 8k | y | y | y | |
> |---------------|
> 4k | x | x | | |
> +---------------+
>
> The second way should be faster than the first one for memory
> management, right?! That a kindda obviuos as it wouldn't be necessary to
> scan all the block to find the next entry. Also it can be expensive
> since the 4k block is allocated for only 2k of real data.
>
> My question is, how does GCC works with this? Does it have any switch
> for optimizing (or not) the code?? What's the default action???
This isn't a compiler issue. The different layouts would require
different source code. The former corresponds to a one-dimensional
array, while the latter corresponds to a two-dimensional array.
--
Glynn Clements <glynn.clements@virgin.net>
next prev parent reply other threads:[~2002-04-09 22:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-09 15:07 GCC and Memory Organization William N. Zanatta
2002-04-09 22:12 ` Glynn Clements [this message]
2002-04-11 12:48 ` William N. Zanatta
2002-04-11 13:22 ` William N. Zanatta
2002-04-11 14:07 ` Glynn Clements
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=15539.26431.760192.203498@cerise.nosuchdomain.co.uk \
--to=glynn.clements@virgin.net \
--cc=linux-c-programming@vger.kernel.org \
--cc=william@veritel.com.br \
/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).