ios - Why is block designed to be allocated on the stack unless copied? -


why has apple designed block allocated on stack unless copied? what's benefit such behavior? why not make behave regular nsobject - alloc-init , goes on heap automatically?

the reason why blocks placed on stack default speed. in common case lifetime of block less of stack function contains it, optimisation.

http://www.cocoawithlove.com/2009/10/how-blocks-are-implemented-and.html


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -