-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
操作系统 #54
Comments
Open
延伸阅读
|
堆和栈的区别1. 栈内存(stack)栈是用来存储函数内部(包括main函数)的局部变量和方法调用和函数参数值,是由系统自动分配的(所以不需要程序员手动管理),一般速度较快;存储地址是连续且存在有限栈容量,会出现溢出现象。 2. 堆内存(heap)堆是由程序员手动分配释放的,通过malloc和new等动态申请内存的语句使用,也需要用户手动回收(或可能在程序结束时OS自动回收,在 iOS 中有 autoreleasepool 会自动释放对象),而对于面向对象程序来说,new出来的任何对象,无论是对象内部的成员变量,局部变量,类变量,他们指向的对象都存储在堆内存中(但指针本身存在栈中),一般速度较栈慢;存储地址通常是链式的,内存较大不会溢出。 参考 |
进程和线程的区别参考: |
寄存器参考 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: