Memory allocations of structure

What is the slack memory concept in allocation of structure memory?

Questions by Ganesh Nikam

Showing Answers 1 - 3 of 3 Answers

mkulacz

  • May 22nd, 2009
 

I think slack memory is the extra memory at the end of a structure which may go unused. It may also include unused memory within a struct. For example, if a struct includes a short and then an int, in that order, the int needs to be on a 4-byte boundary but the short needs to be on a 2-byte boundary. Thus, 2 bytes go to waste. If a stack is allocated from the heap, the memory manager may fragment the heap in a manner where is unused memory contiguously after the stack object. This definition is cloudy, as I couldnt find a real crisp defiition of "slack memory". 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions