[][src]Module cranelift_codegen_shared::constant_hash

Build support for precomputed constant hash tables.

This module can generate constant hash tables using open addressing and quadratic probing.

The hash tables are arrays that are guaranteed to:

  • Have a power-of-two size.
  • Contain at least one empty slot.

This module provides build meta support for lookups in these tables, as well as the shared hash function used for probing.

Functions

generate_table

Compute an open addressed, quadratically probed hash table containing items. The returned table is a list containing the elements of the iterable items and None in unused slots.

simple_hash

A primitive hash function for matching opcodes.