| ... | ... | @@ -13,7 +13,7 @@ allow declarations of the form |
|
|
|
|
|
|
|
|
|
|
|
```wiki
|
|
|
|
foreign space <n> :: Ptr <type>
|
|
|
|
foreign space [const] <n> :: Ptr <type>
|
|
|
|
```
|
|
|
|
|
|
|
|
|
| ... | ... | @@ -28,6 +28,10 @@ the space allocated will be n\*sizeof type for the sizeof as specified by the St |
|
|
|
if the type is 'forall a . Ptr a' then the size will be assumed to be one byte.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if 'const' is specified then that is an assertion the contents of memory there will never change and the haskell compiler may make use of that and the data may be allocated in the shared among processes, read-only data segment.
|
|
|
|
|
|
|
|
|
|
|
|
### initialized data
|
|
|
|
|
|
|
|
|
| ... | ... | @@ -37,7 +41,7 @@ initialized data is trickier, a possible syntax is |
|
|
|
|
|
|
|
```wiki
|
|
|
|
|
|
|
|
foreign space <n> :: Ptr <type> = constant
|
|
|
|
foreign space [const] <n> :: Ptr <type> = constant
|
|
|
|
|
|
|
|
where constant may be one of
|
|
|
|
|
| ... | ... | |