+data StgConInfoTable = StgConInfoTable {
+ conDesc :: CString,
+ infoTable :: StgInfoTable
+}
+
+instance Storable StgConInfoTable where
+ sizeOf conInfoTable
+ = sum [ sizeOf (conDesc conInfoTable)
+ , sizeOf (infoTable conInfoTable) ]
+ alignment conInfoTable = SIZEOF_VOID_P
+ peek ptr
+ = runState (castPtr ptr) $ do
+#ifdef GHCI_TABLES_NEXT_TO_CODE
+ desc <- load
+#endif
+ itbl <- load
+#ifndef GHCI_TABLES_NEXT_TO_CODE
+ desc <- load
+#endif
+ return
+ StgConInfoTable
+ {
+#ifdef GHCI_TABLES_NEXT_TO_CODE
+ conDesc = castPtr $ ptr `plusPtr` conInfoTableSizeB `plusPtr` desc
+#else
+ conDesc = desc
+#endif
+ , infoTable = itbl
+ }
+ poke ptr itbl
+ = runState (castPtr ptr) $ do
+#ifdef GHCI_TABLES_NEXT_TO_CODE
+ store (conDesc itbl `minusPtr` (ptr `plusPtr` conInfoTableSizeB))
+#endif
+ store (infoTable itbl)
+#ifndef GHCI_TABLES_NEXT_TO_CODE
+ store (conDesc itbl)
+#endif
+