Sven Panne wrote:
Am Montag, 13. November 2006 10:53 schrieb Simon Marlow:
Sven Panne wrote:
Fri Nov 10 09:16:26 PST 2006 [EMAIL PROTECTED]
* Make StablePtr and friends visible, this seems to be necessary for
64bit architectures
M ./includes/Rts.h +4
This undoes a previous patch of mine:
Tue Oct 24 10:13:57 BST 2006 Simon Marlow <[EMAIL PROTECTED]>
* Split GC.c, and move storage manager into sm/ directory
In preparation for parallel GC, split up the monolithic GC.c file into
smaller parts. Also in this patch (and difficult to separate,
unfortunatley):
- Don't include Stable.h in Rts.h, instead just include it where
necessary.
That's exactly what my patch does, i.e. make the StablePtr C API visible when
compiling via C. ;-) Parts of the C interface for stable pointers is really
needed when compiling user code (because of primops and DsForeign.lhs, IIRC).
On x86_64, StgStablePtr consists of 8 bytes (a void *), but without any
visible prototypes the C compiler assumes 4 bytes (an int). This causes
crashes when e.g. 'foreign import "wrapper"' is used. This can easily be
checked with most examples in the GLUT package, which heavily rely on Haskell
callbacks.
Ah, so the problem is that Rts.h is included by the generated C stubs for
foreign export, and that code needs to see prototypes from Stable.h. I'd
forgotten that Rts.h was included from there.
Ok, now that I know the issue, I'll clean it up tomorrow. Thanks.
Cheers,
Simon
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc