Newsgroups: fj.os.linux,fj.lang.c
Path: galaxy.trc.rwcp.or.jp!coconuts.jaist!wnoc-tyo-news!aist-nara!odins-suita!ns!tigers!masaoka
From: masaoka@ss.marine.osakafu-u.ac.jp (Koji Masaoka)
Subject: memory allocation limit of gcc
Sender: news@marine.osakafu-u.ac.jp (News System Admin)
Message-ID: <MASAOKA.97Jan7091956@ss.marine.osakafu-u.ac.jp>
Date: Tue, 7 Jan 1997 00:19:56 GMT
Nntp-Posting-Host: ss
Organization: Dept. Marine System Eng., OPU
Lines: 55
Xref: galaxy.trc.rwcp.or.jp fj.os.linux:394 fj.lang.c:3400
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.lang.c&nb=3400&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

$B@52,(B@$BBg:eI\N)Bg3X$G$9!#(B

fj.os.linux$B$H(Bfj.lang.c$B$K%/%m%9%]%9%H$7$F$$$^$9!#(B

gcc$B$NG[Ns3NJ]$N>e8B$K$D$$$F<ALd$5$;$F$/$@$5$$!#(B

$B8=:_!"J*M}8=>]$N?tCM%7%_%e%l!<%7%g%s$r9T$C$F$$$F(B
$B?t@i85$NO"N)J}Dx<0$r2r$/I,MW$,$"$j$^$9!#(B
$B$3$NLdBj$r(BLinux$B$N(Bgcc$B$G2r$$$F$$$k$N$G$9$,!"(B
$BLdBj$,Bg$-$/$J$k$H(B
Segmentation fault (core dumped)
$B$rEG$$$F=*N;$7$F$7$^$$$^$9!#(B

$B$=$3$G!"<!$N$h$&$J<B83MQ$N%W%m%0%i%`$r:n$C$F(B
$BG[Ns3NJ]$N>e8B$rD4$Y$F$_$k$H(Bdouble$B$N>l9g!"(B
a[1048100]$B$"$?$j$,G[Ns3NJ]$N>e8B$K$J$C$F$$$k$h$&$G$9!#(B
[$B;29M(B: 2$B$N(B20$B>h(B=1048576]
---------------------------------------
#include <stdio.h>

void main()
{
    int n;
    scanf("%d",&n);
    {
        double a[n];
        printf("%d\n",sizeof(a));
    }
}
---------------------------------------

$B$=$3$G!"<ALd$G$9$,!"(B
$BG[Ns3NJ]$N>e8B$r$b$C$HBg$-$/$9$kJ}K!$O$"$k$G$7$g$&$+!#(B

$B$A$J$_$K!"(B
Linux kernel: 2.0.0
gcc: 2.7.2
$B$G$9!#(B(Linux$BF~Lg(B ($B%H%C%Q%s(B)$B$+$i%$%s%9%H!<%k(B)
$B<B83$O(Bmemory 32M$B$N%^%7!<%s$H(B
      memory 64M$B$N%^%7!<%s$N(B2$BBf$G9T$C$F$_$^$7$?$,!"(B
$B7k2L$OF1$8$G$7$?!#(B
os$B$N(Bmemory$B$N3NJ]$N>u67$O(Bdmesg$B$G3NG'$7$^$7$?!#(B

$B$=$l$H!"(B
Linux kernel: 1.2.8  <--- (Run Run Linux $BBh(B1$BHG$h$j%$%s%9%H!<%k(B)
gcc: 2.6.3           
memory: 20M 
$B$G<B83$7$^$9$H!"(B
$B>e$N%W%m%0%i%`$NG[Ns$r(Ba[100000000]$B@Z$C$F$b(B
$B<B9T$,$G$-$^$7$?!#(B
$B$=$3$G!"K\Mh$NL\E*$G$"$k?tCM%7%_%e%l!<%7%g%s$r<B9T$5$;$k$H(B
($B$*$=$i$/(B)swap$B$NO"B3$K$J$C$F$^$H$b$K7W;;$O$G$-$^$;$s$G$7$?!#(B

--
$B@52,9'<#!w3$MN%7%9%F%`9)3X2J!%Bg:eI\N)Bg3X(B
