【VS】关于内存分布查看的方式
2017-05-17 16:46
218 查看
class Base
{
public:
int a;
Base()
{
cout<<"Base()"<<endl;
}
~Base()
{
cout<<"~Base()"<<endl;
}
virtual fun()
{
cout <<"Base fun()"<<endl;
}
};
class Derived:public Base
{
public:
Derived()
{
cout<<"Derived()"<<endl;
}
~Derived()
{
cout<<"~Derived()"<<endl;
}
};
选择项目属性 C/C++ 命令行 附加选项 添加 /d1 reportAllClassLayout 则会打印所有的内存信息。。
/d1 reportSingleClassLayoutBase 则是打印单个类的内存信息。。
F7 编译时,选择输出窗口,生成 如下图:
{
public:
int a;
Base()
{
cout<<"Base()"<<endl;
}
~Base()
{
cout<<"~Base()"<<endl;
}
virtual fun()
{
cout <<"Base fun()"<<endl;
}
};
class Derived:public Base
{
public:
Derived()
{
cout<<"Derived()"<<endl;
}
~Derived()
{
cout<<"~Derived()"<<endl;
}
};
选择项目属性 C/C++ 命令行 附加选项 添加 /d1 reportAllClassLayout 则会打印所有的内存信息。。
/d1 reportSingleClassLayoutBase 则是打印单个类的内存信息。。
F7 编译时,选择输出窗口,生成 如下图:
相关文章推荐
- 用vs查看C++类的内存分布
- 使用VS开发人员命令提示符查看C++虚函数表及类内存分布
- 用vs查看C++类的内存分布
- 关于android应用内存占用查看及优化
- 帝国内容页 关于联系方式查看权限
- VC2005查看类的对象内存分布选项
- VS 查看对象内存布局
- 关于安装查看内存泄露工具BoundsChecker 时出错的问题 ERROR432
- vs 2010 express 查看malloc能分配多少内存
- 关于程序在内存中的分布
- 关于C内存组织方式____结构体对齐
- 关于CxImage内存方式转换图像
- 关于8086/88内存寻址方式
- 关于C 内存的分布详解
- vs 2010 express 查看malloc能分配多少内存
- VS 2010 中调试C++项目时无法查看调试内存窗口
- 在VS中查看一个或多个类内存布局的命令
- 关于在8086/88内存寻址方式 (这是我一次复习汇编时看到的好文章,所以转来共享)
- 关于在VS2008以下版本的MFC程序使用VS 2008 FeaturePack出现内存泄露的理解
- 关于linux/android 下LCD /camera等DMA内存的预留和申请——和wince 的方式换汤不换药啊