LinuxプラットフォームでC++プログラムのヒープメモリサイズを見つけるにはどうすればよいですか?newまたはmallocを使用する前にヒープメモリスペースが必要です。プログラムのヒープサイズを取得する方法
#include <malloc.h>
#include <iostream>
int main()
{
//here need heap memory space
unsigned char* I2C_Read_Data= new unsigned char[250];
//get heap memory space After the usage of new
return 0;
}
newとmallocは同じ領域を使用しません。 – UmNyobe
@UmNyobe:通常は 'new'は' :: operator new() 'を呼び出します。これは通常malloc()で実装されています。 ... –
http://stackoverflow.com/questions/1350819/c-free-store-vs-heap – UmNyobe