Path: utzoo!mnetor!motto!dave From: dave@motto.UUCP (dave brown) Newsgroups: comp.lang.c Subject: Re: one pass switch code (was forward references in typedefs) Message-ID: <67@motto.UUCP> Date: 26 Jul 89 17:02:42 GMT References: <55480@tut.cis.ohio-state.edu> <1989Jul20.152935.14872@utzoo.uucp> <686@ftp.COM> <18735@mimsy.UUCP> Reply-To: dave@motto.UUCP (dave brown) Lines: 15 In article <18735@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: >Since the code that implements the switch is not generated until after >all the cases are known, the compiler can select one of the various >alternatives. (Incidentally, heap switches are better for sparse >tables above a moderate number of comparisons. PCC has used all three >of these forms---direct, heap, and jump table switches---for years, and >PCC is a one-pass compiler.) I understand direct and jump table switches, but what's a heap switch? ----------------------------------------------------------------------------- | David C. Brown | uunet!mnetor!motto!dave | | Motorola Canada, Ltd. | 416-499-1441 ext 3708 | | Communications Division | Disclaimer: Motorola is a very big company | -----------------------------------------------------------------------------