Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7739021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:24:58+00:00 2026-06-01T08:24:58+00:00

I have a 64-bit i7 machine. Suppose I allocate memory for n 32-bit integers.

  • 0

I have a 64-bit i7 machine. Suppose I allocate memory for n 32-bit integers. How many physical registers will actually be used in the allocation: n, or n/2?

I tried to write the following simple programme to find out.

#include <iostream>
#include <cstdlib>

using namespace std;

int main (int argc, char *argv[]) {
    int a[4];
    cout << &a[0] << "\t" << &a[3] << endl;
    cin.ignore (1);
    return 0;
} // End main ()

The output is:

0018FA04        0018FA10

They seem further apart than they should be. Why aren’t the addresses 04 and 07? And does this mean that the system is actually allocating four (or more) integers, instead of packing the four 32-bit integers into two 64-bit registers?

Thanks in advance for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:25:00+00:00Added an answer on June 1, 2026 at 8:25 am

    I have a 64-bit i7 machine. Suppose I allocate memory for n 32-bit integers. How many physical registers will actually be used in the allocation: n, or n/2?

    A 64-bit i7 machine is a x86_64 architecture.

    On this architecture an array of 32-bit integers will be allocated fully-packed, meaning the size of the array will be 4n bytes.

    If by physical registers you mean machine words, and you consider a machine word to be 64-bit on x86_64, than yes it will use n/2 machine words.

    I wouldn’t use the word physical registers, this can be confused with cpu registers, which is not where an array (unless very small and optimizer is aggressive) is allocated.

    They seem further apart than they should be. Why aren’t the addresses 04 and 07? And does this mean that the system is actually allocating four (or more) integers, instead of packing the four 32-bit integers into two 64-bit registers?

    Because the architecture is byte-addressed not word-addressed. They are 12 bytes apart as expected.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a 32-bit machine, so I suppose that the memory alignment should
on my 32-bit machine (with an Intel T7700 duo core), I have 15 precision
I have windows 7 (64-bit) and just upgraded IE9 in my machine. I did
I am trying to implement this demo on my local machine. http://bit.ly/4g4o1r I have
We have installed informix client in 64 bit machine. Informix client doesn't include dbaccess
I've looked around and tried many suggestions but none have worked. I recently migrated
On a 32 bit Windows Server 2003 machine I have created a Visual Studio
I have installed the Oracle Client for the 64 bit machine using the XCopy
I have a program built with VB6 and using some 32-bit DLL's . Will
I have a console application which works perfectly in 32 bit machine. But I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.