我有一个基类和一个派生类。在这种设置下,一切都运行得很好。我在基类中添加了另一个类,所以它是一个嵌套类。在为新嵌套类分配内存时,我看到一些内存损坏。我想知道当我们有嵌套类时,基类的大小会增加吗?
发布于 2013-05-18 19:37:49
这些更改很可能隐藏了应用程序代码问题,就像某些内存错误在调试器下运行时不会以同样的方式破坏正在运行的进程一样,这也会改变环境。
但是,使用此文档时,mallopt用于生成值:
MALLOC_ARENA_SIZE
The size of the arena, a chunk of memory that the memory allocator allocates
and deallocates from the system. This value must be a multiple of 4 KB, and
currently is limited to being less than 256 KB. Environment variable:
MALLOC_ARENA_SIZE. 但就像我说的,如果这看起来像是修复了腐败,那就不要相信。最好将竞技场大小设置为暴露应用程序错误的任何值,然后修复错误本身。
https://stackoverflow.com/questions/16622191
复制相似问题