GNU bug report logs -
#4470
23.1; threaded interpreter
Previous Next
Reported by: Tom Tromey <tromey <at> redhat.com>
Date: Thu, 17 Sep 2009 21:05:04 UTC
Severity: wishlist
Tags: patch
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Tom Tromey <tromey <at> redhat.com> writes:
> + static int initialized;
> +
> + if (!initialized)
> + {
> + int i;
> + initialized = 1;
> + /* We must initialize every slot in the table. An empty
> + slot before Bconstant should just abort. All the opcodes
> + after Bconstant should use the same code as Bconstant. */
> + for (i = 0; i < 256; ++i)
> + {
> + if (!targets[i])
> + targets[i] = i < Bconstant ? &&insn_default : &&insn_Bconstant;
> + }
> + }
> +#endif
You can use [0 ... 255] = &&insn_default, [Bconstant ... 255] =
&&insn_Bconstant to statically initialize the array, avoiding the
runtime initialisation.
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
This bug report was last modified 13 years and 14 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.