Special control flags

If the memobj is used to allocate the memory (memobj_create()), you can set processor-specific flags to call shm_ctl_special() on shared memory object.

Note:
Special flags aren't supported on x86 and x86_64 architectures.

Lazy-write mechanism support

You can set the lazy-writing mechanism for the memory by using memobj_attr_set_lazywrite() or memobj_wrap_attr_set_lazywrite(). The memobj library adds the SHMCTL_LAZYWRITE flag for shm_ctl() or shm_ctl_special() call if lazy-write is set.

On ARM architecture (both 32-bit (__arm__) and 64-bit (__aarch64__)), when lazy-write is set, the following special flags should also be included: ARM_SHMCTL_WT | ARM_SHMCTL_SH.

When lazy-write mechanism is enabled, the mapping with PROT_NOCACHE isn't supported.

Typed memory support

If typed-memory is requested, the memobj library either uses the specified typed memory pool or default memory pool (specified in graphics.conf with alloc-pool in globals section). The library calls posix_typed_mem_open() to get the read-write memory with appropriate physical-contiguous flags (based on the memobj create attributes from the user). The memobj library encapsulates this typed memory into its shared memory object, by using shm_ctl(). The memobj library uses this work-around when shm_ctl_special() is required to be used with typed memory. A zero-length shm_ctl_special() is used to set the special flags, and then shm_ctl() is used to set typed memory for shared memory object.

Memory map or unmap

The libmemobj library supports only within-process memory mapping (i.e., mmap()). The mapping between different processes is no longer supported by this library and is done in Screen server and Screen library using shared memory handle mechanism. Upon memobj closure, all mappings related to this object are unmapped.

Page updated: