[VC9/x86] sizeof(std :: vector):20/24个字节? [英] [VC9/x86] sizeof(std::vector): 20/24 bytes?

查看:89
本文介绍了[VC9/x86] sizeof(std :: vector):20/24个字节?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到sizeof(std :: vector)是20(调试模式,启用迭代器调试)或24字节(调试模式,禁用迭代器调试).我想知道,如果禁用迭代器调试,为什么大小会增加?

I noticed sizeof(std::vector) is 20 (debug mode, iterator debugging enabled) or 24 bytes (debug mode, iterator debugging disabled). I'm wondering, why does the size increase if I disable iterator debugging?

为什么大小为24个字节?预计需要12个字节(3个指针),其他8/12个字节又是做什么用的呢?标准分配器?我以为它不存储状态,所以不会使用任何内存.

Why is the size 24 bytes? 12 bytes are expected (3 pointers), what are the other 8/12 bytes used for? The standard allocator? I thought it didn't store state, so wouldn't use any memory.

推荐答案

您为什么在乎?您要解决什么问题?
Why do you care? What problem are you trying to solve?


这篇关于[VC9/x86] sizeof(std :: vector):20/24个字节?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆