posix memory heap fixes for mac