Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LqTGW-0000ER-Ga for mharc-grub-devel@gnu.org; Sun, 05 Apr 2009 10:24:04 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LqTGV-0000EM-9G for grub-devel@gnu.org; Sun, 05 Apr 2009 10:24:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LqTGT-0000EA-AV for grub-devel@gnu.org; Sun, 05 Apr 2009 10:24:02 -0400 Received: from [199.232.76.173] (port=53087 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LqTGT-0000E7-7k for grub-devel@gnu.org; Sun, 05 Apr 2009 10:24:01 -0400 Received: from mail.nexedi.com ([91.121.25.85]:54331 helo=nexedi.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LqTGS-0007r0-K1 for grub-devel@gnu.org; Sun, 05 Apr 2009 10:24:01 -0400 Received: from [10.8.0.46] (unknown [10.8.0.46]) by nexedi.com (Postfix) with ESMTP id DFFA63D9EF for ; Sun, 5 Apr 2009 16:23:55 +0200 (CEST) From: "Yoshinori K. Okuji" Organization: enbug.org To: The development of GRUB 2 Date: Sun, 5 Apr 2009 23:23:54 +0900 User-Agent: KMail/1.9.10 References: <49D68B82.2080001@gmail.com> <20090403160240.189e35cf@gibibit.com> In-Reply-To: <20090403160240.189e35cf@gibibit.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200904052323.55123.okuji@enbug.org> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH] Split of normal mode (version 2) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 14:24:04 -0000 On Saturday 04 April 2009 08:02:40 Colin D Bennett wrote: > What if you switch back and forth between normal and rescue mode > many times in a row? The stack will grow with each call and eventually > the stack will overflow and Bad Things will happen. Yes. > Now you could also return function pointers instead of using > switch/case with enum constants, but it's the same concept. Then > setjmp is another similar way to do it without implementing a central > dispatcher like grub_main above. Exactly. For those who know the concept of continuation, setjmp/longjmp is very handy. This makes some kind of programs to be written easily and simply. Regards, Okuji