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
Algebraic concepts that include certain words and phrases and
Veseljchak [2.6K]

Answer:

Boolean Operators

Explanation:

When performing a boolean search, boolean operators allow users to combine keywords with operators (or modifiers) such as AND, NOT and OR to further produce more relevant results.

The boolean operators AND and OR are used to include certain words and phrases during the search while the  boolean operator NOT is used to exclude certain words and phrases.

6 0
3 years ago
What does ' array ' mean in the context of graphics programming ?
Readme [11.4K]

Answer:

An array is a data structure that contains a group of elements. Typically these elements are all of the same data type, such as an integer or string. Arrays are commonly used in computer programs to organize data so that a related set of values can be easily sorted or searched.

3 0
2 years ago
Peter works on a huge database of numerical figures in a worksheet ranging from cell A1 to cell I50. He has to print the workshe
bekas [8.4K]

Answer:

Landscape or vertical page orientation

Explanation:

In landscape  he can mange the number of cell that are required to print on A4 page size.

On landscape orientation of the page we can add more columns of the sheet. That is the reason, we should choose landscape or horizontal page orientation to adjust all columns on the single page.

8 0
3 years ago
Read 2 more answers
How can i change ip address <br>​
JulijaS [17]

I believe your answer would be:

1: Open the command prompt window. Do this by clicking the "Start" button, and then selecting "Run." In the window that appears, type "cmd" into the text box and click the "OK" button.

2: Release the computer's current IP address. To do this, type "ipconfig /release" into the command prompt window and press Enter.

3: Acquire a new IP address. Do this by typing "ipconfig /renew" into the command prompt window and pressing Enter. This should assign the computer a new IP address, which will be different from the previous address.

4: Cycle your modem's power. If the above steps don't work, you can try renewing your IP address by cycling your modem's power. Turn off both your computer and your modem (and your router, if you have one). Wait at least 5 minutes, then turn everything back on. If your computer is set to receive an IP address dynamically (the most likely configuration), you should be assigned a new IP address automatically.

5: Check to make sure your IP address has changed. To do this, you can log on to a number of different websites that tell you your IP address.

Hope I helped, if so may I get brainliest and a thanks?

Thank you, Have a good day! =)

7 0
3 years ago
"kannst du mir bitte helfen" in German-English from Reverso Context: Hier, kannst du mir bitte helfen?
tatuchka [14]

Answer:

"Come help me, please" "Can you help me here?"

Explanation:

Some form of question or help, i think...

4 0
1 year ago
Other questions:
  • Describe an application where a parallel circuit might work better than a series circuit
    15·2 answers
  • Clearing the computer's cache helps store recently-used information.<br><br> True<br> False
    10·2 answers
  • * Declare a variablecalled "car" of type "Car", and initialise its value to a new instance of the "Car"class.
    9·1 answer
  • The following algorithm should output the t times table in the format:
    6·1 answer
  • ____ is the code of acceptable behaviors users should follow while on the internet; that is, it is the conduct expected of indiv
    10·1 answer
  • In the Advent of computer technologies and it's applications, to what extent these technologies have influenced the world.
    11·1 answer
  • When searching for an image on your computer, you should look for a file with which of the following extensions?
    8·1 answer
  • What is the missing line of code?
    7·2 answers
  • The inFS.open(str) function has a string parameter str that specifies the _____ of the file to open.
    10·1 answer
  • What is the effects of computer and internet attacks​
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!