
26 Mar
2004
26 Mar
'04
1:24 p.m.
data PackedString = PS !(ForeignPtr Word8) !Int !Int
A ForeignPtr is a sum type, so it can't be unboxed unfortunately. This is undoubtedly one cause of inefficiency in the code. Depending on how you're using ForeignPtrs, you could possibly define a specialiased kind of ForeignPtr that would be unboxable. This would require using low-level non-portable stuff though. Are you using mallocForeignPtr? Or adding extra finalizers to ForeignPtrs? Cheers, Simon