Poly/ML version 5.8.2
Major Changes
This release includes a major change to the foreign-function interface (FFI). libffi is no longer used except in the interpreted version and instead interface functions are compiled when the buildXX
function is called. This results FFI calls being very much faster. Generally the high-level interface in the Foreign
structure is unchanged but the low-level structures are different. Foreign.LibFFI
has been removed and there are some changes to the Foreign.LowLevel
structure. The buildCallback
functions have been replaced with buildClosure
functions with a slightly different type. Closures are now garbage-collected so if a closure is created and registered with a foreign module a reference must be retained within ML. For backwards compatibility buildClosure
functions have been retained which are not garbage-collected.
Minor Changes
- Support for IPv6 through the addition of
INet6Sock
andNet6HostDB
structures. - Addition of
PackReal32Big
andPackReal32Little
structures. - Addition of
gcState
field toPolyML.Statistics
. When statistics are exported this allows another process to monitor garbage-collection. This is not useful for local statistics because the local process cannot read the statistics while garbage-collecting. - The word arguments in
Foreign.Memory.++
,--
and the variousget
andset
operations are now treated as signed values. - Added
Foreign.loadLibraryIndirect
. This calls a function before a library is loaded to obtain the name at that point rather than when using the name bound in when the foreign function call is compiled. .sig
is now included in the list of extensions foruse
andPolyML.make
. It is the first choice when looking up a signature inPolyML.make
, allowing the same name to be used for a signature and a structure or functor.Unix.execute
andUnix.executeInEnv
are now implemented in the run-time system rather than in ML usingPosix.Process.fork
andPosix.Process.exec
.fork
is problematic because there is the chance that the new process may have to garbage-collect before callingexec
.- Changes to memory allocation to support executable code areas on platforms such as OpenBSD that do not allow pages to mapped with both execute and write permissions.
- Improvements to speed up the interpreted byte code version.
PolyML.export
no longer exports interpreted code as executable since it is not actually executed.- When exporting to ELF byte data is written to the
.rodata
section and relocatable data to.data.rel.ro
. - Internal changes to
Posix.Process.sleep
,OS.IO.poll
andSocket.select
to avoid arbitrary precision arithmetic in the run-time system. - Internal change to the
Windows
structure to implement it largely using FFI. - Various internal changes to the interface between the run-time system and the basis library.
- Internal change to profiling to reduce the effect of profiling on the running program.
Bug fixes
- Fix exponential blow-up of the compilation in the optimiser/simplifier.
- Fix Bad Address problem with PolyML.objSize in compact 32-bit version.
- Fix InternalError exception when compiling a signature with an invalid type realisation.