1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Aleonysh [2.5K]
1 year ago
6

suppose a malloc implementation returns 8-byte aligned addresses and uses an explicit free list where the next and previous poin

ters are each 32-bits. blocks have a 32-bit header and 32-bit footer, where the low-order bit of the header and footer are used to indicate whether the block is allocated (1) or free (0). furthermore, the block size (which includes the header, payload, footer, and any necessary padding) is rounded up to the nearest multiple of 8, and this size (in bytes) is stored in the header and footer. assume any padding must be between the payload and the footer. if we call malloc(1), what block size will be allocated, in bytes?
Computers and Technology
1 answer:
Naya [18.7K]1 year ago
8 0

4 bytes because even if you call malloc and free a little more frequently, that might still occur. malloc frequently uses the extra space for managing (a linked list of all memory blocks and their sizes) when it takes a few bytes more than what is requested.

There is a good chance that you will tamper with the internal management structures and cause the subsequent malloc of free will to crash if you write some bytes either before or after your allocated block.

4004 because malloc internally always allocates at least four bytes. Your program would be 4000 if you added four bytes, making it 4004. may crash only when you access byte n+1. Additionally, the operating system typically only protects pages of memory.

Your process may be able to read-write the remainder of the page and will only crash when accessing the next memory page if your malloc-ed byte is in the middle of a page with a size of 512 bytes. But keep in mind: Even if this works, the behavior is not clear.

To learn more about internal management here

brainly.com/question/13398903

#SPJ1

Full Question = Suppose a malloc implementation returns 8-byte aligned addresses and uses an explicit free list where the next and previous pointers are each 32-bits. Blocks have a 32-bit header and 32-bit footer, where the low-order bit of the header and footer are used to indicate whether the block is allocated (1) or free (0). Furthermore, the block size (which includes the header, payload, footer, and any necessary padding) is rounded up to the nearest multiple of 8, and this size (in bytes) is stored in the header and footer. Assume any padding must be between the payload and the footer.

a) If we call malloc(1), what block size will be allocated, in bytes?

b) With the same conditions, and assuming we've already called malloc(1), if the heap used by malloc starts at address 0x4000 (16384 in decimal), what address would be returned if we then called malloc(32)?

You might be interested in
What is technology in computer​
qaws [65]

Answer:

she is right or he :)

Explanation:

8 0
2 years ago
In a word-processing program, what are the easily accessible icons that allow you to print, save and change fonts with a click o
Elan Coil [88]

The answer is A. tool bar

7 0
2 years ago
If you notice files being transferred to or from your computer a. Simply close the window c. Tell the lab instructor b. Open a n
a_sh-v [17]

Answer:

The best answer is letter D.  

Explanation:

Downloading of files without your permission is a form of security threat and attack. You as unwilling victim will have your files and private information stolen.

One of the basics of internet security is to terminate any connection that you have in a network to stop the possible attack or threat. Worst case scenario is we can shut down our computers or devices or gadgets. But if we can just terminate the connection without performing a force shut down on the device, it is much better. This will give us more time to save what we are working on and to prevent losing important works or data. Terminating the connection from the network comes in various activities such as:  

*Disconnect from the internet - this is one of the most effective method. As most of the attacks are coming from external threats such a hacking.  

*Closing the browser - this could be helpful as well. Hackers are using browser to monitor their victims. And malwares and adwares are most active while we use browsers as they are embedded and using it to propagate to peform their activities.  

*Disconnect from the local network - if you have closed the internet connection and any active software that you are working on presently and the downloading of files still persists, probably the attack comes from your local network. You must close any connection that you have within the local network.

*Deleting the recent files you have downloaded - You must delete any recent files that you just downloaded from your email or from the internet. There might be malware embedded in the file. Malwares are used by hackers to get in to their victims computer without them knowing it.

Then after terminating all the connections, you must call on your Instructor's attention. He / She is the authority in charge and must be aware of the situation.

5 0
2 years ago
Read 2 more answers
Which member of the restaurant and food/beverage service career is mostly likely to plan menus and direct worker
kumpel [21]

What are the options for the question

5 0
3 years ago
Read 2 more answers
Fordham3 Hardware is known for its consensus buying center culture. Recognizing this corporate culture, someone attempting to se
balandron [24]

Answer: (c) focus exclusively on the head of the buying center.

Explanation:

As Fordham3 Hardware is known for its consensus buying center culture, so someone attempting to sell to Fordham3 should focus exclusively on the head of the buying center.

8 0
3 years ago
Other questions:
  • A job application is a form used to make a job request.<br> True<br> False
    8·2 answers
  • 12. Noodle Tools is a website that
    8·1 answer
  • On Brainly, how can I change my username? from halfsidepancake​
    6·2 answers
  • Write a function named printtriangle that receives a parameter that holds a non-negative integer value and prints a triangle of
    7·1 answer
  • Arrange the steps below to outline what maia needs to do to accomplish this task.​
    9·1 answer
  • Which K-Drama was made in 2009?
    5·2 answers
  • Your digital footprint says a lot about you, but not everything is true or accurate. When you're a high school or college studen
    13·1 answer
  • Are you absent minded because you are thinking of an online activity?​
    12·1 answer
  • Write a program to output 3 lines of text with the following information:
    7·1 answer
  • Design algorithm and the corresponding flow chart for adding the subject score of 5, total value and rank.​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!