Article View: comp.os.linux.misc
Article #514Re: g77, release memory used for local variables ?
From: Alexander Viro
Date: Fri, 13 Feb 1998 00:00
Date: Fri, 13 Feb 1998 00:00
16 lines
1557 bytes
1557 bytes
But wait a minute, it actually _uses_ 160Mb! In your example compiler could optimize it away (well, it could optimize away the whole thing) but consider the following modification: caller allocates 80Mb array and writes something there; test1 also allocates 80Mb and uses it; test1 finishes and deallocate his 80Mb; after that the caller continues to use _his_ array. When the test1 runs it should have 80Mb for its own array _and_ the first array should be preserved somewhere. After all, caller would be very upset if his very own array would disappear or would lose its content. So when the test1 is being executed you need 160Mb total. No matter where you'll place it, but you can't get out alive without this amount under any system with any compiler. Al
Technical Details
Message-ID:
<6c0k7v$hb9@riemann.math.psu.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<980213122956.M0305016@sakura.kudpc.kyoto-u.ac.jp>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10684a,b22f12d0b3d158d4 X-Google-Attributes: gid10684a,public X-Google-Thread: 1103af,b22f12d0b3d158d4 X-Google-Attributes: gid1103af,public X-Google-Thread: f9b51,b22f12d0b3d158d4 X-Google-Attributes: gidf9b51,public X-Google-Thread: 102983,b22f12d0b3d158d4 X-Google-Attributes: gid102983,public From: viro@math.psu.edu (Alexander Viro) Subject: Re: g77, release memory used for local variables ? Date: 1998/02/13 Message-ID: <6c0k7v$hb9@riemann.math.psu.edu> X-Deja-AN: 324671086 References: <980213122956.M0305016@sakura.kudpc.kyoto-u.ac.jp> Organization: Penn State University, Department of Mathematics Newsgroups: comp.os.linux.misc,comp.os.linux.setup,fj.os.linux,aus.computers.linux