[project @ 2003-09-10 14:45:24 by simonmar]
authorsimonmar <unknown>
Wed, 10 Sep 2003 14:45:24 +0000 (14:45 +0000)
committersimonmar <unknown>
Wed, 10 Sep 2003 14:45:24 +0000 (14:45 +0000)
commitbd6a0427c90e9dec8d520e2fd6190770c46c044a
tree7b9b99268d879bdb398dfd44ba8314c27212593a
parent26021ff9493fb5bceba65415e8689e0d2a170d5e
[project @ 2003-09-10 14:45:24 by simonmar]
Quick hack to work around the dynamic exception crashes in GHCi.  The
problem is this: the Data.Typeable library (Data.Dymamic in previous
versions of GHC) maintains an internal cache mapping type names to
unique numbers, and this cache is used for fast comparisons on
TypeReps.  In GHCi, there are actually two versions of the
Data.Typeable library loaded: one linked to GHCi itself, and the other
dynamically loaded, so there are two copies of the hash tables.

The problem is that if we have a Dynamic value generated using one set
of hash tables, it will erroneously appear to be of a different type
when the other hash tables are used.

The hack I've instigated is to use the central RTS genSym (which
already exists) to generate the unique Ids, so that the two copies of
the dynamic library will be using distinct Ids, and Dynamics from one
will never be recognisable to the other.
Data/Typeable.hs