一,内存管理关系

1.内存布局:
栈区:函数,⽅法
堆区:通过alloc分配的对象,block copy
BSS段:未初始化的全局变量,静态变量(静态区)
数据段: 初始化的全局变量,静态变量(常量区)
text:程序代码,加载到内存中
栈区内存地址:⼀般为:0x7开头
堆区内存地址:⼀般为:0x6开头
数据段,BSS内存地址:⼀般为:0x1开头
image.png
在类中尽量封装函数少用方法,用空间换取时间,减轻编译器识别方法的负担。
1.内存管理方案:




栈区:函数,⽅法
堆区:通过alloc分配的对象,block copy
BSS段:未初始化的全局变量,静态变量(静态区)
数据段: 初始化的全局变量,静态变量(常量区)
text:程序代码,加载到内存中
栈区内存地址:⼀般为:0x7开头
堆区内存地址:⼀般为:0x6开头
数据段,BSS内存地址:⼀般为:0x1开头
image.png
在类中尽量封装函数少用方法,用空间换取时间,减轻编译器识别方法的负担。
本文标题:内存优化探索
本文链接:https://www.haomeiwen.com/subject/aivafktx.html
网友评论