読書記録ChangeLog / 2003-10-08

日記内を検索  前の日 / 次の日 / 最新 / ランダム RSS

2003-10-08 Wed

ヒープメモリの上限

エキスパート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 / 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

uzoyoto@dkiroku.com

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