Wrapping existing memory (wrap.h)

The functions defined in wrap.h enable you to create a new memory object handle that wraps existing memory.

Description:

To create a wrapped memory object, provide its required attributes via the memobj_wrap_attr structure, which is created and managed with the memobj_wrap_attr_ set of functions. After one or more memory object handles are created, the wrap attribute structure should be destroyed via a memobj_wrap_attr_destroy() call.

To create a wrapped memory object, the client has to specify either shared memory file descriptor and offset for the existing memory or its virtual address.

For the wrapped memory objects, you can also specify a destructor for the memory. This destructor is called when the last memory object handle associated with this memory is closed.

Page updated: