creared some inline functions to access the meminfo structure.
make math functions non inline because they are not used in this compile unit anyway
add some definitions to get this build under mingw
omit pthread for now