|== Open Questions ==
|The following topics still require a bit of discussion or a decision between multiple alternatives.
|=== Reinitialisation after `hs_exit()` ===
|The FFI addendum currently requires that `hs_exit()` can be followed by another `hs_init()`. GHC doesn't support that and I am not convinced that we should require it. I propose to remove that requirement.
|'''TODO:''' Decide whether we remove the requirement for re-initialisation.
|=== Alignment ===
|Except for `mallocBytes` & `allocaBytes`, the original FFI addendum does not specify any constraints on alignment for allocated memory (by `mallocForeignPtrBytes` and others). This is clearly an oversight. The questions is how we want to express the fact that all routines that allocate memory specified in bytes must conform to a set of alignment constraints (this was proposed by Thomas !DuBuisson and John Meacham) We may add the following statement concerning alignment at the beginning of Section 5 (which describes the library modules):
| All storage allocated by functions that allocate based on a '''size in bytes''' must be sufficiently aligned for any of the basic foreign types (see Section 3.2) that fits into the newly allocated storage. All storage allocated by functions that allocated based on a '''specific type''' must be sufficiently aligned for that type. Array allocation routines need to obey the same alignment constraints for each array element.
|'''TODO:''' Decide whether we want to add this text. If not, we need to find an alternative way of expressing the required alignment constraints.