C stack

Jan Kort kort@wins.uva.nl
Thu, 14 Dec 2000 15:03:34 +0100


Hi,

I'm trying to write an interface for a C library that
uses a Boehm type garbage collector. So, I need to get
the address of the bottom of the C stack. In a C
application this would look something like:
  main()
  {
    int bottomOfStack;
  }
Where "&bottomOfStack" would be the thing I need. So,
I'd want some function like:
  bottomOfStack :: IO Addr

Would it be possible at all to make an interface to
a C library that uses Boehm's garbage collection ?
What Boehm's algorithm does is traverse the C stack
at each garbage collect marking all accessible
nodes and then sweeping all unmarked nodes. Would
this cause problems with the C code generated by
ghc ?

  Jan