Re: 'goto' in the kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 19, 2001 at 04:37:32PM +0200, Etay Meiri wrote:

> Hi,
> 
> Why do the kernel hackers make such an
> extensive use of 'goto's in the kernel?

two reasons

1) code clarity. when a routine needs a successive set of initialisations,
   they must be done in reverse order. The natural way to do this is a
   goto heirarchy. Contrary to what you may have been told, goto is not
   a mortal sin.

2) performance. in some cases, using goto's improves the generated assembly

regards
john

-- 
How many Bavarian Illuminati does it take to screw in a lightbulb?

Three: one to screw it in, and one to confuse the issue. 
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux