26

Re: And why not to make a stack it is even cleverer?

Hello, Pavel Dvorkin, you wrote: PD> Hello, uzhas, you wrote: U>> clang You did not begin to splice two stack variables and its this right PD> is right, and it is wrong Anything wrong here is not present. Laying down p2 there where p1, would demand superfluous , first of all, on sweep of a stack after the first printf (). The superfluous command of manipulation %esp would cost more expensive, than those of 4 bytes. Here if them was 4000, most likely, would make such sweep.

27

Re: And why not to make a stack it is even cleverer?

Hello, Pavel Dvorkin, you wrote: PD>>> I Think that cannot, and is obliged. U>> in an example above it can, but is not obliged. To you if only to argue? PD> yes is not present, it is simple here the stack mechanism of selection, and its this consequence. PD>>> differently the memory size can increase in N time without any sense. U>> a phrase without any sense. To me here to be frightened number N? PD> At big enough size of local variables and decent N to receive out of the blue stack overflow there where it is possible to manage without it - to be frightened I did not become, but would express authors of the code unflatteringly. Measure, most likely, not "in N time", without understanding that multiply by it N - and _ _ the expense increased.

28

Re: And why not to make a stack it is even cleverer?

Hello, Kingofastellarwar, you wrote: K> i.e. all operators new caused in methods of this object In  and becomes, and in crosses normal people and so a heap once again do not pull.

29

Re: And why not to make a stack it is even cleverer?

Hello, Kingofastellarwar, you wrote: K> a feature for the compiler: K> here we for example transfer  or we create local  and why if there are no special instructions all that will be dynamic selected by it and with derived objects not to select too in a stack? K> i.e. all operators new caused in methods of this object if there are no special instructions, will be  in stack K> for example by transmission of lines, it is possible then to do without generally reversal to a heap because std:: string h () {return std:: string (' a ', 1000);} std:: string g () {char x [10]; return h ();} std:: string f () {g (); char x [5000];} draw on a piece of paper that where it should be stored after each step, and all becomes clear to you.