読書記録ChangeLog

日記内を検索 / / / ランダム RSS

2003-10-08 / ヒープメモリの上限 /

エキスパートCプログラミングp183より

#include <stdio.h>
#include <stdlib.h>
int main(){
  int Mb=0;
  while (malloc(1<<20)) ++Mb;
  printf("Allocated %d Mb total\n",Mb);
  return 0;
}

% cc -xarch=v9 tmal2.c ; a.out
Allocated 9023 Mb total

% cc tmal2.c ; a.out
Allocated 2042 Mb total

% gcc tmal2.c ; a.out
Allocated 2042 Mb total

固定リンク [2003-10-08-1] このエントリーをはてなブックマークに追加 MM/memo投稿

[ コメント |

これまでの訪問者は 人です。