The Port Library is a platform abstraction library for operating-system-level services, excluding those handled by the Thread Library.
The Port Library is designed to be a standalone component that can be used to add multiplatform support to many projects. Thus Port Library APIs must not have dependencies on other OMR components, such as the Garbage Collector (GC) or Compiler. They can use omrthread_ APIs.
In addition to abstracting platform-dependent details, Port Library APIs also support diagnostic features such as tracing and memory usage tracking.
Port Library APIs are published through a table of function pointers, the OMRPortLibrary structure.
Port Library APIs are conventionally invoked using convenience macros. This facilitates abstraction of the function table implementation.
OMRPORT_ACCESS_FROM_OMRVMTHREAD(omrVmThread); void *buffer = omrmem_allocate_memory(1024, OMRMEM_CATEGORY_MM);