From: Matti Aarnio <matti.aarnio@zmailer.org>
To: Huo Zhigang <zghuo@gatekeeper.ncic.ac.cn>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: Re: what`s wrong?
Date: Thu, 25 Apr 2002 12:50:34 +0300 [thread overview]
Message-ID: <20020425125034.O1284@mea-ext.zmailer.org> (raw)
In-Reply-To: <7754BE8DC82.AAA4CC2@gatekeeper.ncic.ac.cn>
On Thu, Apr 25, 2002 at 05:12:21PM +0800, Huo Zhigang wrote:
...
> >The entire kernel stack is only 8kB in size. You have already killed
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >a bunch of random memory by allocating this much memory on the stack.
> >You allocated 4*8192 = 32kB on the stack here.
>
> Sure, the kernel stack is 8192 Bytes, but "err_frame[]" is a local
> variable. Does the kernel allocate memory for "err_frame[]" from the
> stack??
It is not about how KERNEL does it, but how C (programming language)
does it. If you don't know C's memory management things regarding
various classes of variables, I suggest you pick some good reference
book and study it asap.
> Here, I think, err_frame[] as a function parameter will take 8K in
> the kernel stack. Am I correct?
Sorry, this isn't "programming in C"-education forum..
> Thank you.
/Matti Aarnio
prev parent reply other threads:[~2002-04-25 9:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-25 9:12 Huo Zhigang
2002-04-25 9:50 ` Matti Aarnio [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020425125034.O1284@mea-ext.zmailer.org \
--to=matti.aarnio@zmailer.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zghuo@gatekeeper.ncic.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®