我的Malloc在我的项目中失败。 Malloc通过其中一个功能运行多次,但由于内存不足而失败。使用选项“/ HEAP:1 [,10]”指定的无效数字“
我想增加我的VC++的堆大小,但它给了我在主题中的上述错误。
有人可以告诉我这是什么问题吗?
Windows server 2003 R2企业版 而我正在使用VC++ 98版本。
我试过一些搜索,但无法得到任何关于如何使用/ HEAP OPTION的决定性结论。 数字应该以MB为单位吗?
message_t* Allocate_momory(MsgType_t msgType, UInt16 dataLength)
{
// TO DO: Allocate memenory and return the pointer
message_t* mes_t;
mes_t = (message_t*) malloc(sizeof (message_t));
mes_t->msgType = msgType;
mes_t->dataLength = 0;
mes_t->clientID = 0;
mes_t->usageCount = 0;
mes_t->dataBuf = malloc(sizeof (dataLength));
return mes_t;
}
是它的工作...但不幸的是没有使用malloc解决我的问题:(!! 这是太多文件一个巨大的工程。 我不能发布的代码,但可以有人指导我如何我应该尝试调试其中的malloc失败
你能发表一些代码吗? – Inisheer 2012-08-05 05:43:53
我想: - 但我不能摆脱error.invalid数字指定选项“/HEAP:11.0” – 2012-08-05 05:51:04