News for hackers. Stuff that matters.
Re:Will it optimize? by notaddicted on Friday July 23, 2010 @01:24PM (#1541780)
Since "result" is on the stack it will only be allocated at the time of the function call. Also note that the stack grows downwards in memory. To get the memory layout you've shown you'd have to be summing up the bytes in the unallocated memory between the heap and the top of the stack. Probably this is explained somehow in the standard but I don't personally know.
Re:Will it optimize? by ramchip on Saturday July 24, 2010 @12:47AM (#1543119)
"result" is not necessarily on the stack, and stack growth direction is implementation-specific: http://stackoverflow.com/questions/664744/what-is-the-direct...