本文介绍了CAN"杂包1 QUOT;有助于避免堆碎片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的节目,我看到一些居民尺寸增加。我想这是因为堆碎片。
所以我打算使用的#pragma包1
这将减少堆不成?

In my program I see some resident size increase. I suppose it is because of heap fragmentation.So I am planning to use #pragma pack 1.Will it reduce the heap fragmentation?

会不会是有一些其他的开销?

Will it be having some other overheads?

我应该去为它或不?

推荐答案

有一个名为 。它的设计特别是减少内存碎片和内存泄漏帮助。它应该在情况下使用,其中内存碎片变成的程序功能的瓶颈。

There is a well proved technique called Memory pools. It is designed especially to reduce memory fragmentation and help with memory leaks. And it should be used in case where memory fragmentation became the bottleneck of the program functionality.

杂包1是没有帮助的,以避免堆碎片。

'pragma pack 1' isn't helpful to avoid heap fragmentation.

杂组件1'用来从结构去除填充字节,以帮助程序之间的二进制结构的传输

'pragma pack 1' is used to remove the padding bytes from structures to help with transmission of binary structures between programs.

这篇关于CAN"杂包1 QUOT;有助于避免堆碎片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-25 18:07