Idea for capabilities
After looking at the source code in Capabilities.c I think a rudimentary implementation to add dynamic capabilities can work like this:
- Wait, until it is safe to change the capabilities structure.
- Allocate memory for number_of_capabilities + 1
- Copy old capabilities structure to new allocated one
- Relink to new memory location
To be honest, I don’t think it’s so easy; but at least this is a starting point I can use. Currently, I have to things to think about and which have to be solved before I can hack around in the code:
- How can I call C code in the RTS from Haskell?
- When is it safe to modify the capabilities structure?
Happy for any suggestions,
Michael