iOS about stacks, variable storage and other problems resolution

Source: Internet
Author: User

When the code block is over, the inside of the A,b,*c pointer will be automatically reclaimed by the system compiler, because it is stored in the stack, and the OC object will not be reclaimed by the system, because it is stored in the heap, the memory inside the heap is dynamically stored, so the programmer needs to manually reclaim memory summary differences


According to the management of the stack, is automatically managed by the system compiler, do not need to manually manage the programmer for the heap, release work by the programmer manual management, not timely recovery prone to memory leaks by allocating the heap is allocated and reclaimed memory dynamically, There are two ways to allocate a stack without statically allocating: static allocation and dynamic allocation of static allocations are done by the system compiler, such as the allocation of local variables is alloc function allocation, but the dynamic allocation of the stack and the heap is different, and its dynamic distribution by the system compiler to release, No programmer manual Management required



Source: Http://www.jianshu.com/p/c8e1d91dda99

iOS about stacks, variable storage and other problems resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.